Bug 544078 - Support PHPUnit 8.x
Summary: Support PHPUnit 8.x
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PHP UI CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-03 10:54 EST by Maik Greubel CLA
Modified: 2020-05-14 13:26 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maik Greubel CLA 2019-02-03 10:54:50 EST
In my unit test I got this error using PHPUnit 8.0:

Failed asserting that exception of type "Error" matches expected exception "Generics\Socket\SocketException". Message was: "Class 'PHP_Timer' not found" at
C:\Users\Maik\AppData\Local\Temp\phpunit_printer\PHPUnitLogger.php:780
D:\web\phpGenerics\src\Generics\Socket\ClientSocket.php:54
D:\web\phpGenerics\tests\socket-tests\ClientSocketTest.php:26
Comment 1 Eclipse Genie CLA 2019-02-03 10:58:11 EST
New Gerrit change created: https://git.eclipse.org/r/136205
Comment 2 Maik Greubel CLA 2019-02-03 13:03:02 EST
In fact, PHPUnit 7.x introduced the dependency phpunit/php-timer:^2.0

https://packagist.org/packages/phpunit/phpunit#7.0.0

vs

https://packagist.org/packages/phpunit/phpunit#6.5.x-dev
Comment 3 Dawid Pakula CLA 2019-02-09 06:20:42 EST
Thank You!
Comment 5 Thierry BLIND CLA 2019-02-13 11:23:01 EST
Thank you very much for your patch Maik, help is always welcome! ;)

But just one (big) comment: was it really necessary to completely destroy the code formatting of the PHPUnitLogger.php file? :/

I'll do some cleanup/revert on top of your patch when I have again a bit of time...

Thierry.
Comment 6 Eclipse Genie CLA 2019-02-13 11:40:15 EST
New Gerrit change created: https://git.eclipse.org/r/136863
Comment 8 Abdull CLA 2019-11-26 08:14:03 EST
Is this really fixed in 6.3.0.201909061650? Because I'm getting the following warning, and the test execution fails:

```
Warning: Class 'SebastianBergmann\Timer\Timer' not found in C:\Users\FOO\AppData\Local\Temp\phpunit_printer\PHPUnitLogger.php on line 52

Call Stack:
    0.0240     917992   1. {main}() C:\Users\FOO\git\dotenv\phpunit-8.4.phar:0
    0.1570   10267120   2. PHPUnit\TextUI\Command::main(???) C:\Users\FOO\git\dotenv\phpunit-8.4.phar:647
    0.1570   10267232   3. PHPUnit\TextUI\Command->run(???, ???) phar://C:/Users/FOO/git/dotenv/phpunit-8.4.phar/phpunit/TextUI/Command.php:66
    0.1570   10267232   4. PHPUnit\TextUI\Command->handleArguments(???) phar://C:/Users/FOO/git/dotenv/phpunit-8.4.phar/phpunit/TextUI/Command.php:73
    0.1580   10270200   5. PHPUnit\TextUI\Command->handlePrinter(???, ???) phar://C:/Users/FOO/git/dotenv/phpunit-8.4.phar/phpunit/TextUI/Command.php:561
    0.1600   10367776   6. require('C:\Users\FOO\AppData\Local\Temp\phpunit_printer\PHPUnitLogger.php') phar://C:/Users/FOO/git/dotenv/phpunit-8.4.phar/phpunit/TextUI/Command.php:613
    0.1600   10367968   7. class_alias(???, ???) C:\Users\FOO\AppData\Local\Temp\phpunit_printer\PHPUnitLogger.php:52
```
Comment 9 Dawid Pakula CLA 2019-11-27 05:59:14 EST
I prepared bug #553526