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

PHPUnit_Util_Type::isType() in combination with autloader raises error #38

Closed
obechny opened this issue Oct 5, 2010 · 2 comments
Closed

Comments

@obechny
Copy link

obechny commented Oct 5, 2010

Affected version 3.5.

If assertType() assertion is used with autoloader, autoloader tries to load asserted type as php file. For example with Zend Framework autoloader enabled, calling assertType('array', array()) results in error include_once(array.php): failed to open stream: No such file or directory.

This could be fixed by setting parameter $autoload=false to functions class_exists() and interface_exists() in PHPUnit_Util_Type::isType().

@sebastianbergmann
Copy link
Owner

You should use assertInternalType() instead. This new assertion method has been added in PHPUnit 3.5 to solve this problem.

@obechny
Copy link
Author

obechny commented Oct 5, 2010

Thank you, I haven't noticed mentioned assertion.

axiac pushed a commit to axiac/phpunit that referenced this issue May 8, 2018
This reverts commit 0617e54.
This issue was closed.
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

No branches or pull requests

2 participants