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

Drop support for PHP < 7.2 + Fixed tests + Code gromming #66

Merged
merged 9 commits into from Jan 10, 2020

Conversation

@lyrixx
Copy link
Member

lyrixx commented Jan 10, 2020

No description provided.

@lyrixx lyrixx changed the title Fixed tests Fixed tests for PHP >= 7.2 Jan 10, 2020
@lyrixx lyrixx changed the title Fixed tests for PHP >= 7.2 Drop support for PHP < 7.2 + Fixed tests + Code gromming Jan 10, 2020
@lyrixx lyrixx mentioned this pull request Jan 10, 2020
@pyrech
pyrech approved these changes Jan 10, 2020
Copy link
Member

pyrech left a comment

Awesome, thanks

$phar = new \Phar($pharPath);
$phar->buildFromDirectory($rootPackage, '#(src|tests/fixtures|vendor)#');
$phar->buildFromIterator($files, $rootPackage);

This comment has been minimized.

Copy link
@lyrixx

lyrixx Jan 10, 2020

Author Member

You will be amazed by the technique I used to find this issue. Read bellow to discover it 👇

There was a really strange error

1) Joli\JoliNotif\tests\NotificationTest::testItExtractsIconFromPhar
Phar::buildFromDirectory(): read of 8192 bytes failed with errno=21 Is a directory

/home/gregoire/dev/github.com/jolicode/JoliNotif/tests/NotificationTest.php:45

I googled at it ... nothing interesting. I read the PHP source code ... nothing interesting
Ouch ❗️
So I used one of my favorite tool to mid-hardcore debug ... strace
And in few secondes I understand what was wrong:

$ strace vendor/bin/simple-phpunit
[...]
stat("/home/gregoire/dev/github.com/jolicode/JoliNotif/vendor/bin/.phpunit/phpunit-6.5/phpunit", {st_mode=S_IFREG|0755, st_size=653, ...}) = 0                                                
stat("/home/gregoire/dev/github.com/jolicode/JoliNotif/vendor/symfony/phpunit-bridge/bin/simple-phpunit", {st_mode=S_IFREG|0755, st_size=9544, ...}) = 0                                      
write(1, "Phar::buildFromDirectory(): read"..., 163Phar::buildFromDirectory(): read of 8192 bytes failed with errno=21 Is a directory   
@lyrixx lyrixx force-pushed the better-test-suites branch from 8f558cd to 933d3dd Jan 10, 2020
@pyrech pyrech merged commit 382cf48 into master Jan 10, 2020
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@pyrech pyrech deleted the better-test-suites branch Jan 10, 2020
@pyrech

This comment has been minimized.

Copy link
Member

pyrech commented Jan 10, 2020

Thank you @lyrixx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.