Skip to content

Conversation

@BusterNeece
Copy link
Contributor

See issue #143 for details.

Some help writing the unit tests for this would be much appreciated; not sure how to best approach testing a version-specific piece of functionality like this.

@BusterNeece
Copy link
Contributor Author

BusterNeece commented Dec 8, 2019

Minor update: the $property->isInitialized($object) method also requires that setAccessible(true) be set before it is checked, in the same style as getValue, so it needs to be moved further down in the processing. The latest commit takes care of that.

@theofidry
Copy link
Collaborator

theofidry commented Dec 8, 2019

Thanks for the patch!

I think for the test you could create a fixture class with typed properties along the existing ones, a test cloning it once the properties are initialised and another when it's not. Since this test should be done only in PHP 7.4 you can use a @requires PHP 7.4 tag to it

@BusterNeece
Copy link
Contributor Author

I've created some PHP-7.4-specific unit tests and a new test class namespace to specifically address this functionality. I also added PHP 7.4 as a testing target for Travis CI.

Coveralls seems to think that the overall coverage is reduced...since this is a PHP 7.4-specific block of code, maybe that check should be suppressed for other versions?

Copy link
Member

@mnapoli mnapoli left a comment

Choose a reason for hiding this comment

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

Since the build issue is just coveralls being picky, to me it's OK to merge.

@theofidry good for you?

@theofidry
Copy link
Collaborator

theofidry commented Dec 15, 2019 via email

@mnapoli
Copy link
Member

mnapoli commented Dec 15, 2019

Thank you @SlvrEagle23

@mnapoli mnapoli merged commit 579bb73 into myclabs:1.x Dec 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants