defuse/php-encryption

PHP 8.0 testing support on Travis-CI (tests of v2.3.0 pass locally on PHP 8.0.3)

defuse opened this issue · 2 comments

It's all fucked up, probably due to using an old version of phpunit:

Begin Unit Testing

PHP Warning:  Private methods cannot be final as they are never overridden by other classes in phar:///home/travis/build/defuse/php-encryption/phpunit.phar/phpunit/Util/Configuration.php on line 162

Warning: Private methods cannot be final as they are never overridden by other classes in phar:///home/travis/build/defuse/php-encryption/phpunit.phar/phpunit/Util/Configuration.php on line 162

PHPUnit 5.7.27 by Sebastian Bergmann and contributors.

PHP Fatal error:  Uncaught Error: Class "PHP_Token_NAME_QUALIFIED" not found in phar:///home/travis/build/defuse/php-encryption/phpunit.phar/php-token-stream/Token/Stream.php:189

Stack trace:

#0 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/php-token-stream/Token/Stream.php(118): PHP_Token_Stream->scan('<?php\n\nnamespac...')

#1 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/php-code-coverage/CodeCoverage.php(764): PHP_Token_Stream->__construct('<?php\n\nnamespac...')

#2 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/php-code-coverage/CodeCoverage.php(673): SebastianBergmann\CodeCoverage\CodeCoverage->getLinesToBeIgnored('/home/travis/bu...')

#3 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/php-code-coverage/CodeCoverage.php(321): SebastianBergmann\CodeCoverage\CodeCoverage->applyIgnoredLinesFilter(Array)

#4 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/php-code-coverage/CodeCoverage.php(1104): SebastianBergmann\CodeCoverage\CodeCoverage->append(Array, 'UNCOVERED_FILES...')

#5 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/php-code-coverage/CodeCoverage.php(256): SebastianBergmann\CodeCoverage\CodeCoverage->initializeData()

#6 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/phpunit/Framework/TestResult.php(650): SebastianBergmann\CodeCoverage\CodeCoverage->start(Object(BackwardsCompatibilityTest))

#7 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/phpunit/Framework/TestCase.php(868): PHPUnit_Framework_TestResult->run(Object(BackwardsCompatibilityTest))

#8 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/phpunit/Framework/TestSuite.php(733): PHPUnit_Framework_TestCase->run(Object(PHPUnit_Framework_TestResult))

#9 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/phpunit/Framework/TestSuite.php(733): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))

#10 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/phpunit/TextUI/TestRunner.php(517): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))

#11 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/phpunit/TextUI/Command.php(186): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array, true)

#12 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/phpunit/TextUI/Command.php(116): PHPUnit_TextUI_Command->run(Array, true)

#13 /home/travis/build/defuse/php-encryption/phpunit.phar(598): PHPUnit_TextUI_Command::main()

#14 {main}

  thrown in phar:///home/travis/build/defuse/php-encryption/phpunit.phar/php-token-stream/Token/Stream.php on line 189

Fatal error: Uncaught Error: Class "PHP_Token_NAME_QUALIFIED" not found in phar:///home/travis/build/defuse/php-encryption/phpunit.phar/php-token-stream/Token/Stream.php:189

Stack trace:

#0 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/php-token-stream/Token/Stream.php(118): PHP_Token_Stream->scan('<?php\n\nnamespac...')

#1 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/php-code-coverage/CodeCoverage.php(764): PHP_Token_Stream->__construct('<?php\n\nnamespac...')

#2 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/php-code-coverage/CodeCoverage.php(673): SebastianBergmann\CodeCoverage\CodeCoverage->getLinesToBeIgnored('/home/travis/bu...')

#3 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/php-code-coverage/CodeCoverage.php(321): SebastianBergmann\CodeCoverage\CodeCoverage->applyIgnoredLinesFilter(Array)

#4 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/php-code-coverage/CodeCoverage.php(1104): SebastianBergmann\CodeCoverage\CodeCoverage->append(Array, 'UNCOVERED_FILES...')

#5 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/php-code-coverage/CodeCoverage.php(256): SebastianBergmann\CodeCoverage\CodeCoverage->initializeData()

#6 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/phpunit/Framework/TestResult.php(650): SebastianBergmann\CodeCoverage\CodeCoverage->start(Object(BackwardsCompatibilityTest))

#7 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/phpunit/Framework/TestCase.php(868): PHPUnit_Framework_TestResult->run(Object(BackwardsCompatibilityTest))

#8 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/phpunit/Framework/TestSuite.php(733): PHPUnit_Framework_TestCase->run(Object(PHPUnit_Framework_TestResult))

#9 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/phpunit/Framework/TestSuite.php(733): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))

#10 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/phpunit/TextUI/TestRunner.php(517): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))

#11 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/phpunit/TextUI/Command.php(186): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array, true)

#12 phar:///home/travis/build/defuse/php-encryption/phpunit.phar/phpunit/TextUI/Command.php(116): PHPUnit_TextUI_Command->run(Array, true)

#13 /home/travis/build/defuse/php-encryption/phpunit.phar(598): PHPUnit_TextUI_Command::main()

#14 {main}

  thrown in phar:///home/travis/build/defuse/php-encryption/phpunit.phar/php-token-stream/Token/Stream.php on line 189

The command "./test.sh" exited with 255.

But then, to update to a later version of PHPUnit, you have to add : void to the overriden functions setUp(), tearDown(), etc., and that language feature doesn't exist in PHP 5.6, so I think in order to support testing on PHP 8 we have to drop support for PHP 5.6.

the tests pass locally with php 8.0.3 so this is something wrong with travis

fuck it I will just run the tests manually whenever I cut a release