Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: serialization of test suits static properties #1208

Closed
wants to merge 4 commits into from
Closed

Fix: serialization of test suits static properties #1208

wants to merge 4 commits into from

Conversation

majkel89
Copy link
Contributor

When --backupStaticAttributes switch is set, static properties of classes derived from PHPUnit_Framework_Test are also backed up due to wrong use of instanceof.

string instanceof object|class|string is always false. One should use is_a(stringClassName, stringClassName, true).

This bug affect all versions of PHPUnit that uses PHPUnit_Util_GlobalState class.

When --backupStaticAttributes switch is set static properties of classes derived from PHPUnit_Framework_Test are also backed up due to wrong use of instanceof.

<string> instanceof <object>|<class>|<string> is always false. One should use is_a(<stringClassName>, <stringClassName>, true).

This bug affect all versions of PHPUnit that uses PHPUnit_Util_GlobalState class.
@sebastianbergmann
Copy link
Owner

Your patch is not compatible with PHP 5.3.3 (see Travis).

is_a in PHP 5.3.3 does not support third parameter (allow_string) thus $object parameter cannot be string.
@sebastianbergmann
Copy link
Owner

Cherry-picked into 4.0.

@majkel89 majkel89 deleted the patch-1 branch September 14, 2014 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants