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

Call to undefined method getActualAsString() #3910

Closed
ghost opened this issue Jul 8, 2014 · 3 comments
Closed

Call to undefined method getActualAsString() #3910

ghost opened this issue Jul 8, 2014 · 3 comments
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Jul 8, 2014

While unit testing in CakePHP 2.5.1, I stumbled upon a bug with the error:

Error: Call to undefined method
PHPUnit_Framework_ComparisonFailure_Scalar::getActualAsString()
File: /cake_2.5.1/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php
Line: 257

The issue also exists in CakePHP 2.5.2.

CakePHP's build.xml file requires PHPUnit minimum version of 3.5.0. PHPUnit v4.0 has the functions getActual() and getActualAsString(). However v4.1.1 only has getActual() [OS: Ubuntu v14.04].

@lorenzo
Copy link
Member

lorenzo commented Jul 8, 2014

PHPUnit 4.0+ does not play nice with CakePHP 2.x. Pleas stick to the 3.7 version

@lorenzo lorenzo closed this as completed Jul 8, 2014
@lorenzo lorenzo added this to the 2.5.3 milestone Jul 8, 2014
@lorenzo lorenzo added the testing label Jul 8, 2014
hmic pushed a commit to hmic/cakephp that referenced this issue Aug 24, 2014
Trim off the query string before attempting to locate the file on the
filesystem. Thanks to Marko Marković for the initial patch.

Fixes cakephp#3910
@betocrod
Copy link

Not really only PHPUnit4.0+, I also had this problem using PHPUnit 3.5, but upgrading to PHPUnit 3.7.32 (As suggested by cakephp) solved the problem.

Conclusion: If using cakephp, only use PHPUnit 3.7.32

@markstory
Copy link
Member

Any of the 3.7 releases prior to 3.7.32 should work as well. As should 3.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants