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

PHPT tests failing because of whitespace #1115

Closed
Ocramius opened this issue Jan 28, 2014 · 6 comments
Closed

PHPT tests failing because of whitespace #1115

Ocramius opened this issue Jan 28, 2014 · 6 comments

Comments

@Ocramius
Copy link
Contributor

I am not quite sure if this is caused by #1101, but I am getting some weird failures in PHPT tests when matching against a pattern:

1) /home/travis/build/Ocramius/ProxyManager/tests/language-feature-scripts/access-interceptor-denies-private-property-isset.phpt
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'bool(false)'
+'bool(false)
+'

In this case, it seems like the missing newline at end of the PHPT test is causing a failure - that may well be a breakage and I can fix my tests if that's the case.

2) /home/travis/build/Ocramius/ProxyManager/tests/language-feature-scripts/access-interceptor-denies-private-property-read.phpt
Failed asserting that format description matches text.
--- Expected
+++ Actual
@@ @@
-Fatal error: Cannot access private property %s::$sweets in %s on line %d
+
+Fatal error: Cannot access private property Kitchen::$sweets in /home/travis/build/Ocramius/ProxyManager/src/ProxyManager/GeneratorStrategy/EvaluatingGeneratorStrategy.php(65) : eval()'d code on line 93
+
+Call Stack:
+    0.0001     233736   1. {main}() -:0
+    0.0195    2072208   2. ProxyManagerGeneratedProxy\__PM__\Kitchen\YToxOntzOjc6ImZhY3RvcnkiO3M6NTY6IlByb3h5TWFuYWdlclxGYWN0b3J5XEFjY2Vzc0ludGVyY2VwdG9yVmFsdWVIb2xkZXJGYWN0b3J5Ijt9->__get() -:14
+    0.0195    2076392   3. stdClass->ProxyManagerGeneratedProxy\__PM__\Kitchen\{closure}() /home/travis/build/Ocramius/ProxyManager/src/ProxyManager/GeneratorStrategy/EvaluatingGeneratorStrategy.php(65) : eval()'d code:98
+
+

As it seems to me here (may be completely wrong), the difference in the output is because of XDebug being enabled or disabled while running the tests.
Before PHPUnit 3.9 (and probably more precisely #1101), XDebug was not enabled by default in the PHPT scope, while now it is (I'm not sure if the previous runner explicitly disabled extensions).

Running the tests with php -n does not fix the problem here, since the newly spawned processes still run with XDebug enabled.

The failing build that made me notice this is https://travis-ci.org/Ocramius/ProxyManager/jobs/17480668, which uses @3f3ea308393fd2b9aff4356beb62b5ef6c0efb27

I can't analyze the problem locally via git bisect - did something change in how PHPUnit autoloading is setup? I'm constantly getting Fatal error: Class 'PHPUnit_TextUI_Command' not found in ... when doing git bisect locally, while master, 3.7 and 3.8 work just fine...

@whatthejeff
Copy link
Contributor

@sebastianbergmann, I believe there are two things missing from our alternative to PEAR_RunTest:

  1. PEAR_RunTest trimmed the sections.
  2. PEAR_RunTest has some default INI settings.

Also, while not one of the problems mentioned in this issue, I think PEAR_RunTest uses a different format for matching strings.

@whatthejeff
Copy link
Contributor

@Ocramius, can you see if @sebastianbergmann's changes have solved some of your issues?

@Ocramius
Copy link
Contributor Author

Ocramius commented Feb 8, 2014

@whatthejeff I'm trying it right now

@Ocramius
Copy link
Contributor Author

Ocramius commented Feb 8, 2014

@whatthejeff @sebastianbergmann this seems to fix the issue, thanks!

@sebastianbergmann
Copy link
Owner

Thanks for testing @Ocramius!

@whatthejeff
Copy link
Contributor

Thanks, @Ocramius and @sebastianbergmann!

Ocramius added a commit to Ocramius/ProxyManager that referenced this issue Feb 14, 2014
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

3 participants