diff --git a/.travis.yml b/.travis.yml index 60661b9..6b17fb0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,7 +51,7 @@ script: - php ${EXTRA_CONFIG} -r "echo phpversion() . PHP_EOL;" - if [ ${HHVM_PHP7+x} ]; then echo "Do not test the lowest dependencies on HHVM with PHP7 support"; else travis_wait composer update --prefer-lowest --no-interaction && php -d hhvm.jit=0 -d error_reporting=$(php -r "var_export(E_ALL & ~E_DEPRECATED);") vendor/bin/phpunit; fi - - travis_wait composer update --no-interaction && php -d hhvm.jit=0 ${EXTRA_CONFIG} vendor/bin/phpunit + - travis_wait rm -f composer.lock && composer update --no-interaction && php -d hhvm.jit=0 ${EXTRA_CONFIG} vendor/bin/phpunit after_script: - mv ~.git .git diff --git a/CHANGELOG.md b/CHANGELOG.md index 155910d..6f7c949 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.10.1 + +* Removed support for PHPUnit ^5.0 && ^6.0 - there are issue with HHVM and `Throwable`, +in HHVM `Exception` does not implement `Throwable` + ## 0.10.0 * Removed `Awesomite\StackTrace\Arguments\Values\MultipleValues` diff --git a/composer.json b/composer.json index d708246..a72143e 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,6 @@ } }, "autoload-dev": { - "files": ["tests/hhvm-polyfill/exceptions.php.polyfill"], "psr-4": { "Awesomite\\StackTrace\\": "tests/" } @@ -28,7 +27,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7.19 || ^6.1.3", + "phpunit/phpunit": "^4.8.35", "satooshi/php-coveralls": "^1.0.1 || ^2.0.0", "sebastian/comparator": ">=1.2.3" }, diff --git a/src/StackTrace.php b/src/StackTrace.php index d334811..3c4b96f 100644 --- a/src/StackTrace.php +++ b/src/StackTrace.php @@ -18,7 +18,7 @@ */ class StackTrace implements StackTraceInterface { - const VERSION = '0.10.0'; + const VERSION = '0.10.1'; const CONSTRAINTS_VERSION = '>=0.1.0 <0.11.0'; private $arrayStackTrace; diff --git a/tests/Arguments/Declarations/DeclarationProviders.php b/tests/Arguments/Declarations/DeclarationProviders.php index 76c0fe6..61b9009 100644 --- a/tests/Arguments/Declarations/DeclarationProviders.php +++ b/tests/Arguments/Declarations/DeclarationProviders.php @@ -56,7 +56,7 @@ public function providerGetType() } // on version 7.1.0beta1 there is wrong type - array instead of iterable - if (version_compare(PHP_VERSION, '7.1.0RC1') >= 0) { + if (version_compare(PHP_VERSION, '7.1.0RC1') >= 0 && !defined('HHVM_VERSION')) { $class71 = new \ReflectionClass(new TestPhp71()); list($parameterIterable) = $class71->getMethod('argumentIterable')->getParameters(); $result[] = array(new Declaration($parameterIterable), true, 'iterable'); diff --git a/tests/BaseTestCase.php b/tests/BaseTestCase.php index 673ec4f..c9c2300 100644 --- a/tests/BaseTestCase.php +++ b/tests/BaseTestCase.php @@ -5,36 +5,11 @@ /** * @internal */ -class BaseTestCase extends BridgeTestCase +class BaseTestCase extends \PHPUnit_Framework_TestCase { protected function setUp() { parent::setUp(); $this->expectOutputString(''); } - - /** - * @param string $exception - * @param string|null $message - * @param int|null $code - */ - public function setExpectedException($exception, $message = '', $code = null) - { - $reflection = new \ReflectionClass('Awesomite\StackTrace\BaseTestCase'); - $parentReflection = $reflection->getParentClass(); - if ($parentReflection->hasMethod('setExpectedException')) { - parent::setExpectedException($exception, $message, $code); - return; - } - - $this->expectException($exception); - - if ($message !== null && $message !== '') { - $this->expectExceptionMessage($message); - } - - if ($code !== null) { - $this->expectExceptionCode($code); - } - } } diff --git a/tests/BridgeTestCase.php b/tests/BridgeTestCase.php deleted file mode 100644 index cf20663..0000000 --- a/tests/BridgeTestCase.php +++ /dev/null @@ -1,21 +0,0 @@ -_startTest($test); - } - - final public function endTest(\PHPUnit_Framework_Test $test, $time) - { - $this->_endTest($test, $time); - } - - final public function addError(\PHPUnit_Framework_Test $test, \Exception $e, $time) - { - $this->_addError($test, $e, $time); - } - - final public function addFailure(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_AssertionFailedError $e, $time) - { - $this->_addFailure($test, $e, $time); - } - - final public function addIncompleteTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) - { - $this->_addIncompleteTest($test, $e, $time); - } - - final public function addRiskyTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) - { - $this->_addRiskyTest($test, $e, $time); - } - - final public function addSkippedTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) - { - $this->_addRiskyTest($test, $e, $time); - } - - final public function endTestSuite(\PHPUnit_Framework_TestSuite $suite) - { - $this->_endTestSuite($suite); - } - - final public function startTestSuite(\PHPUnit_Framework_TestSuite $suite) - { - $this->_startTestSuite($suite); - } -} diff --git a/tests/Listeners/BridgeTestListener6x.php b/tests/Listeners/BridgeTestListener6x.php deleted file mode 100644 index 029f365..0000000 --- a/tests/Listeners/BridgeTestListener6x.php +++ /dev/null @@ -1,65 +0,0 @@ -_addError($test, $e, $time); - } - - final public function addWarning(Test $test, Warning $e, $time) - { - $this->_addWarning($test, $e, $time); - } - - final public function addFailure(Test $test, AssertionFailedError $e, $time) - { - $this->_addFailure($test, $e, $time); - } - - final public function addIncompleteTest(Test $test, \Exception $e, $time) - { - $this->_addIncompleteTest($test, $e, $time); - } - - final public function addRiskyTest(Test $test, \Exception $e, $time) - { - $this->_addRiskyTest($test, $e, $time); - } - - final public function addSkippedTest(Test $test, \Exception $e, $time) - { - $this->_addSkippedTest($test, $e, $time); - } - - final public function startTestSuite(TestSuite $suite) - { - $this->_startTestSuite($suite); - } - - final public function endTestSuite(TestSuite $suite) - { - $this->_endTestSuite($suite); - } - - final public function startTest(Test $test) - { - $this->_startTest($test); - } - - final public function endTest(Test $test, $time) - { - $this->_endTest($test, $time); - } -} diff --git a/tests/Listeners/BridgeTestListenerBody.php b/tests/Listeners/BridgeTestListenerBody.php deleted file mode 100644 index 2ef978f..0000000 --- a/tests/Listeners/BridgeTestListenerBody.php +++ /dev/null @@ -1,49 +0,0 @@ -offset) { return; } - $name = ($test instanceof \PHPUnit_Framework_TestCase) || ($test instanceof TestCase) + $name = $test instanceof \PHPUnit_Framework_TestCase ? get_class($test) . '::' . $test->getName() : get_class($test); diff --git a/tests/hhvm-polyfill/StackTraceException.php.polyfill b/tests/hhvm-polyfill/StackTraceException.php.polyfill deleted file mode 100644 index 70fd20b..0000000 --- a/tests/hhvm-polyfill/StackTraceException.php.polyfill +++ /dev/null @@ -1,10 +0,0 @@ -= 0; - -if ($isHhvm && $isPhp7 && !interface_exists('\Throwable', false)) { - /** - * @internal - */ - interface Throwable - { - } - - require_once __DIR__ . DIRECTORY_SEPARATOR . 'StackTraceException.php.polyfill'; -}