From 28eeb84f8ef1028a4d7544cd4781c52f4e790a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Pr=C3=A9vot?= Date: Thu, 14 Feb 2019 12:45:22 -1000 Subject: [PATCH 1/2] Update for recent version of PHPUnit --- src/constraint/image.php | 6 +++--- src/regression_suite.php | 8 ++++---- src/regression_test.php | 4 ++-- src/test/case.php | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/constraint/image.php b/src/constraint/image.php index 7c837ab..eb0a141 100644 --- a/src/constraint/image.php +++ b/src/constraint/image.php @@ -30,7 +30,7 @@ * @package UnitTest * @version //autogentag// */ -class ezcTestConstraintSimilarImage extends PHPUnit_Framework_Constraint +class ezcTestConstraintSimilarImage extends PHPUnit\Framework\Constraint { /** * Filename of the image to compare against. @@ -152,7 +152,7 @@ public function evaluate( $other, $description = '', $returnResult = false ) * @param string $description A string with extra description of what was * going on while the evaluation failed. * @param boolean $not Flag to indicate negation. - * @throws PHPUnit_Framework_ExpectationFailedException + * @throws PHPUnit\Framework\ExpectationFailedException */ public function fail( $other, $description, SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure = NULL ) { @@ -166,7 +166,7 @@ public function fail( $other, $description, SebastianBergmann\Comparator\Compari $failureDescription = $description . "\n" . $failureDescription; } - throw new PHPUnit_Framework_ExpectationFailedException( + throw new PHPUnit\Framework\ExpectationFailedException( $failureDescription, $comparisonFailure ); diff --git a/src/regression_suite.php b/src/regression_suite.php index f93e73d..d24bf8d 100644 --- a/src/regression_suite.php +++ b/src/regression_suite.php @@ -27,7 +27,7 @@ /** * @package UnitTest */ -class ezcTestRegressionSuite extends PHPUnit_Framework_TestSuite +class ezcTestRegressionSuite extends PHPUnit\Framework\TestSuite { public function __construct( $theClass = '', $name = '' ) { @@ -77,7 +77,7 @@ public function __construct( $theClass = '', $name = '' ) !$constructor->isPublic() ) { $this->addTest( - new PHPUnit_Framework_Warning( + new PHPUnit\Framework\Warning( sprintf( 'Class "%s" has no public constructor.', $theClass->getName() @@ -94,7 +94,7 @@ public function __construct( $theClass = '', $name = '' ) && !$theClass->isSubclassOf( 'ezcTestRegressionTest' ) ) { $this->addTest( - new PHPUnit_Framework_Warning( + new PHPUnit\Framework\Warning( sprintf( 'Class "%s" is not a subclass of ezcTestRegressionTest.', $theClass->getName() @@ -115,7 +115,7 @@ public function __construct( $theClass = '', $name = '' ) if ( empty( $tests ) ) { $this->addTest( - new PHPUnit_Framework_Warning( + new PHPUnit\Framework\Warning( sprintf( 'No regression tests found in class "%s".', $theClass->getName() diff --git a/src/regression_test.php b/src/regression_test.php index 56e74f3..5b9839c 100644 --- a/src/regression_test.php +++ b/src/regression_test.php @@ -129,7 +129,7 @@ public function runTest() { if ( $this->currentFile === false ) { - throw new PHPUnit_Framework_ExpectationFailedException( "No currentFile set for test " . __CLASS__ ); + throw new PHPUnit\Framework\ExpectationFailedException( "No currentFile set for test " . __CLASS__ ); } $exception = null; @@ -155,7 +155,7 @@ public function runTest() public static function suite() { - return new PHPUnit_Framework_TestSuite( __CLASS__ ); + return new PHPUnit\Framework\TestSuite( __CLASS__ ); } } ?> diff --git a/src/test/case.php b/src/test/case.php index 5775cdf..aa0d919 100644 --- a/src/test/case.php +++ b/src/test/case.php @@ -30,7 +30,7 @@ * @package UnitTest * @version //autogentag// */ -abstract class ezcTestCase extends PHPUnit_Framework_TestCase +abstract class ezcTestCase extends PHPUnit\Framework\TestCase { /** * Do not mess with the temp dir, otherwise the removeTempDirectory might From e51a818ba82e1fb0289fab6a44f4d79fa31f30fb Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Sun, 17 Feb 2019 21:29:36 +0000 Subject: [PATCH 2/2] Added Travis configuration --- .travis.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..1e8590e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,20 @@ +language: php + +php: + - 5.6 + - 7.0 + - 7.1 + - 7.2 + - 7.3 + - nightly + +matrix: + allow_failures: + - php: nightly + +before_script: + - composer self-update + - composer update + +script: + - vendor/bin/phpunit