Support PHPUnit 6 for testing extensions

This commit is contained in:
Haralan Dobrev
2017-04-22 15:26:03 +03:00
parent ef680be80e
commit 8ebaf8e644
2 changed files with 9 additions and 3 deletions
+6 -2
View File
@@ -9,13 +9,16 @@
* file that was distributed with this source code.
*/
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Constraint\Exception as ExceptionConstraint;
/**
* Integration test helper.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Karma Dordrak <drak@zikula.org>
*/
abstract class Twig_Test_IntegrationTestCase extends PHPUnit_Framework_TestCase
abstract class Twig_Test_IntegrationTestCase extends TestCase
{
/**
* @return string
@@ -196,7 +199,8 @@ abstract class Twig_Test_IntegrationTestCase extends PHPUnit_Framework_TestCase
if (false !== $exception) {
list($class) = explode(':', $exception);
$this->assertThat(null, new PHPUnit_Framework_Constraint_Exception($class));
$constraintClass = class_exists(ExceptionConstraint::class) ? ExceptionConstraint::class : \PHPUnit_Framework_Constraint_Exception::class;
$this->assertThat(null, new $constraintClass($class));
}
$expected = trim($match[3], "\n ");
+3 -1
View File
@@ -1,5 +1,7 @@
<?php
use PHPUnit\Framework\TestCase;
/*
* This file is part of Twig.
*
@@ -8,7 +10,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
abstract class Twig_Test_NodeTestCase extends PHPUnit_Framework_TestCase
abstract class Twig_Test_NodeTestCase extends TestCase
{
abstract public function getTests();