Comments (13)
This bug exists in PHPUnit 3.5.0RC1 but has been fixed in PHPUnit 3.5.0RC2.
Unfortunately running this test under RC2 will raise another issue. I've documented this issue here: http://github.com/sebastianbergmann/phpunit/issues/issue/17
from phpunit.
It seems this bug wasn't fixed completely.
I'm running 3.5.0RC2 (under Windows) this code:
namespace Application\TasksBundle\Tests\Model; class StackTest extends \PHPUnit_Framework_TestCase { public function testPushAndPop() {} }
Using this command:
phpunit -c tasks ./src\Application\TasksBundle\Tests\Model
(there's just phpunit.xml in tasks with processIsolation="true")
And what i get is:
1) Application\TasksBundle\Tests\Model\StackTest::testPushAndPop RuntimeException: Parse error: syntax error, unexpected $end in - on line 136
Though, it works fine if i either:
- cd tasks and run the command from there (without '-c tasks' argument). OR
- Remove 'namespace Application\TasksBundle\Tests\Model;' OR
- Set processIsolation="false"
from phpunit.
I don't really think this is the same problem. The previous issue happened regardless of namespaces and configuration files and had something to do with single quotes not being escaped properly while globals and constants were being serialized for process isolation.
As for your issue, I can't seem to recreate this with the instructions you've provided. Are you using a bootstrap file or anything that hasn't been posted here?
from phpunit.
Meze, maybe your issue is more closely related to http://github.com/sebastianbergmann/phpunit/issues#issue/27. I haven't had the opportunity to test on a Windows system yet.
from phpunit.
I finally got a chance to test on Windows 7 (x86-64), but I still couldn't duplicate this bug. Is there any other information you can provide?
from phpunit.
Yes, i'm using a bootstrap which loads symfony 2,
Here is the code generated by TestCase::run and a piece that opens a process from runJob::php(): http://dl.dropbox.com/u/4488482/issue14.zip
It prints
Array ( [stdout] => Parse error: syntax error, unexpected $end in - on line 140 [stderr] => )
Weird, if i remove any line - it doesn't return that parse error
from phpunit.
I definitely see a syntax error in the generated code that you've attached. The line that unserializes the UniversalClassLoader has some null terminators in it. Unfortunately, this still isn't enough for me to reproduce the error. If you could attach another zip with the following files I think I could figure out what is going on:
- C:\www\taskManager\tasks\phpunit.xml
- C:\www\taskManager\tasks\autoload.php
- C:\www\taskManager\tasks\TasksKernel.php
- C:\www\taskManager\src\autoload.php
- C:\www\taskManager\src\vendor\symfony\src\Symfony\Component\HttpFoundation\UniversalClassLoader.php
- C:\www\taskManager\src\vendor\propel\runtime\lib\Propel.php
- C:\www\taskManager\src\vendor\symfony\src\Symfony\Component\HttpKernel\Kernel.php
- C:\www\taskManager\src\vendor\symfony\src\Symfony\Component\HttpKernel\HttpKernelInterface.php
- C:\www\taskManager\src\Application\TasksBundle\Tests\Model\TaskTest.php
from phpunit.
null terminators are ok, this is how php serializes private properties. removing them doesn't help. Attaching files won't help either (because i renamed C:\www\taskManager before i reproduced the error). Guess the bug is in PHP Version 5.3.3 VC6 under windows. Thank you for trying to help.
from phpunit.
You are correct that PHP serializes private properties with null terminators. I guess textmate doesn't like literal null characters as it reports that line as a syntax error. I apologize for not looking too much further into it.
I'm actually testing with PHP 5.3.3 under windows. It's just very difficult for anyone to reproduce an error if you're not willing to provide a real working example with source code. The only thing you've provided is PHP files which require a bunch of files that no one else has access to. I'm pretty familiar with the process isolation code and I'd really like to help track down this bug but there's not much I can do if you're not willing to provide any code. Maybe sebastian will be able to take a better guess at it than I can.
from phpunit.
I tried to provide as less code as possible. I have removed C:\www\taskManager directory temporarily and the error is still can be reproduced. I hope you haven't made any changes in 'output' file, because when i remove/change a line, the error mysteriously disappears.
from phpunit.
It's not a phpunit related bug.
I've posted a bug report on php.net (http://bugs.php.net/bug.php?id=52911)
let's wait for their answer ;)
from phpunit.
While we wait for a fix in a future version of PHP, I've created a workaround using the comment on the bug page. I proposed a workaround in http://github.com/sebastianbergmann/phpunit/pull/41.
from phpunit.
Pulled the fix from Bourke.
from phpunit.
Related Issues (20)
- Add option to limit export of arrays
- Change default value for `shortenArraysForExportThreshold` from `0` to `10`
- PHPUnit's error handler is not registered if Symfony is booted in a "before class" hook
- Doubled methods cannot be called from destructor on test double created by the return value generator HOT 14
- missing the upport to method Enum::cases() HOT 1
- Allow different file name to class name mapping HOT 2
- Include hint in deprecation notice for `--group`, `--exclude-group`, `--covers`, `--uses`, and `--test-suffix CLI` options HOT 1
- Text coverage report no longer shows colours HOT 13
- No good upgrade path for `processUncoveredFiles` HOT 9
- Testdox no longer outputs in real-time HOT 8
- Testdox prints random warning icons HOT 4
- Increase PHPStan Rule Level to 9
- Add a priority for hooks HOT 1
- Weird behaviour when mocking spread operator as argument. HOT 1
- Errors during write of `phpunit.xml` are not handled correctly when `--generate-configuration` is used
- `durationSincePrevious()` does not yield time since previous event of same type HOT 2
- Mark a test as passed although its expectation fail HOT 1
- symlinks ignored in stack trace file paths HOT 1
- `Test\Passed` event is not emitted for PHPT tests HOT 5
- Proposal: Accessing Thrown Exceptions HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpunit.