Skip to content

Fix makefile.global for apache2 module name patch#1069

Merged
morozov merged 2 commits intophpbrew:masterfrom
markwu:fix-makefile.global-for-Apache2ModuleNamePatch
Dec 9, 2019
Merged

Fix makefile.global for apache2 module name patch#1069
morozov merged 2 commits intophpbrew:masterfrom
markwu:fix-makefile.global-for-Apache2ModuleNamePatch

Conversation

@markwu
Copy link
Contributor

@markwu markwu commented Dec 7, 2019

Fix Apache2 module name patch for php 7.4 and older version. I just bring $build and $logger arguments to rules(), then I can get different rules set for different version

Fixes #1060.

@coveralls
Copy link

coveralls commented Dec 7, 2019

Coverage Status

Coverage increased (+0.04%) to 40.258% when pulling 8f29b33 on markwu:fix-makefile.global-for-Apache2ModuleNamePatch into 01f24a6 on phpbrew:master.

@morozov
Copy link
Contributor

morozov commented Dec 7, 2019

@markwu please make sure you update the tests accordingly. The patch now requires a version.

@markwu
Copy link
Contributor Author

markwu commented Dec 7, 2019

@morozov How do I run the test to make sure everything okay?

@morozov
Copy link
Contributor

morozov commented Dec 7, 2019

@markwu, first you need to do composer install if you haven't already, then you do vendor/bin/phpunit.

Some existing tests are ridiculously slow and should be reworked, so if the whole suite takes too long, you can run just the failing test and make sure it passes:

$ vendor/bin/phpunit tests/PhpBrew/Patches/Apache2ModuleNamePatchTest.php

PHPUnit 4.8.36 by Sebastian Bergmann and contributors.

Runtime:	PHP 7.3.12 with Xdebug 2.8.0
Configuration:	/home/morozov/Projects/phpbrew/phpunit.xml.dist

E

Time: 126 ms, Memory: 8.00MB

There was 1 error:

1) PhpBrew\Tests\Patches\Apache2ModuleNamePatchTest::testPatch
ArgumentCountError: Too few arguments to function PhpBrew\Patches\Apache2ModuleNamePatch::__construct(), 0 passed in /home/morozov/Projects/phpbrew/tests/PhpBrew/Patches/Apache2ModuleNamePatchTest.php on line 35 and exactly 1 expected

/home/morozov/Projects/phpbrew/src/PhpBrew/Patches/Apache2ModuleNamePatch.php:14
/home/morozov/Projects/phpbrew/tests/PhpBrew/Patches/Apache2ModuleNamePatchTest.php:35

FAILURES!
Tests: 1, Assertions: 1, Errors: 1.

@markwu
Copy link
Contributor Author

markwu commented Dec 8, 2019

Okay, I already add a test for this PR, test both 5.5.17 and 7.4.0.

PHPUnit 4.8.36 by Sebastian Bergmann and contributors.

Runtime:	PHP 7.3.12 with Xdebug 2.8.1
Configuration:	/Users/mark/Temp/phpbrew/phpunit.xml.dist

..

Time: 8.95 seconds, Memory: 24.56MB

OK (2 tests, 18 assertions)

I also rebase/squash the commits to 2, one for fix the patch, one for add test.

@markwu
Copy link
Contributor Author

markwu commented Dec 8, 2019

BTW, there are lot of error notice when generating the testing report.

Generating code coverage report in Clover XML format ... done

Generating Crap4J report XML file ... done

Generating code coverage report in HTML format ...PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /Users/mark/Temp/phpbrew/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/File.php on line 313
PHP Stack trace:
PHP   1. {main}() /Users/mark/Temp/phpbrew/vendor/phpunit/phpunit/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /Users/mark/Temp/phpbrew/vendor/phpunit/phpunit/phpunit:52
PHP   3. PHPUnit_TextUI_Command->run() /Users/mark/Temp/phpbrew/vendor/phpunit/phpunit/src/TextUI/Command.php:100
PHP   4. PHPUnit_TextUI_TestRunner->doRun() /Users/mark/Temp/phpbrew/vendor/phpunit/phpunit/src/TextUI/Command.php:149
PHP   5. PHP_CodeCoverage_Report_HTML->process() /Users/mark/Temp/phpbrew/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:501
PHP   6. PHP_CodeCoverage_Report_HTML_Renderer_File->render() /Users/mark/Temp/phpbrew/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML.php:121
PHP   7. PHP_CodeCoverage_Report_HTML_Renderer_File->renderSource() /Users/mark/Temp/phpbrew/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/File.php:82
PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /Users/mark/Temp/phpbrew/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/File.php on line 313

@morozov
Copy link
Contributor

morozov commented Dec 8, 2019

Please rebase. I cleaned up the test suite a bit yesterday. The rest is inevitable due to the outdated PHPUnit used with a new PHP.

@morozov morozov merged commit d61711d into phpbrew:master Dec 9, 2019
@morozov
Copy link
Contributor

morozov commented Dec 9, 2019

Thank you @markwu!

@morozov morozov self-assigned this Dec 9, 2019
@markwu markwu deleted the fix-makefile.global-for-Apache2ModuleNamePatch branch December 9, 2019 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PHP 7.4.0 cannot be compiled with +apxs2 in Ubuntu 19.10

3 participants