Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Fix testCount for PHP 7.2 #81

Closed
wants to merge 1 commit into from

Conversation

remicollet
Copy link
Contributor

@remicollet remicollet commented Oct 24, 2017

PHP 7.2 raise a deprecated message
Parameter must be an array or an object that implements Countable

I think this should not be hidden (count could take care of this),
so this change declare the message as expected.

A new test is added for object which are really countable

Detected by Fedora QA with 7.2.0RC4
https://apps.fedoraproject.org/koschei/package/php-zendframework-zend-stdlib?collection=f28

PHP 7.2 raise a deprecated message
  Parameter must be an array or an object that implements Countable

I think this should not be hidden (count could take care of this),
so this change declare the message as expected.

A new test is added for object which are really countable
public function testCountable()
{
$ar = new ArrayObject(new TestAsset\ArrayObjectObjectCount());
$this->assertEquals(42, $ar->count());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use assertCount.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a copy/paste from previous test, I don't want to do refactoring in a PR only design to fix a minor compatibility issue.

Feel free to open a separate PR if you really think this worth the work ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You add these new lines, so please use the correct method. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok.
No time for Bikeshedding.

public function testCountable()
{
$ar = new ArrayObject(new TestAsset\ArrayObjectObjectCount());
$this->assertEquals(42, $ar->count());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You add these new lines, so please use the correct method. Thanks!

@froschdesign
Copy link
Member

@remicollet
Thanks! 👍

@remicollet remicollet deleted the issue-php72 branch October 24, 2017 10:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants