minor #21697 Refactored other PHPUnit method calls to work with namespaced PHPUnit 6 (peterrehm)
This PR was merged into the 3.3-dev branch.
Discussion
----------
Refactored other PHPUnit method calls to work with namespaced PHPUnit 6
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | no
| Fixed tickets | -
| License | MIT
| Doc PR | -
Continued work to make Symfony PHPUnit 6 compatible.
Commits
-------
e9f3faf
Refactored other PHPUnit method calls to work with namespaced PHPUnit 6
This commit is contained in:
commit
a1dbe041f7
@ -23,7 +23,7 @@ class PdoCacheTest extends CacheTestCase
|
|||||||
public static function setupBeforeClass()
|
public static function setupBeforeClass()
|
||||||
{
|
{
|
||||||
if (!extension_loaded('pdo_sqlite')) {
|
if (!extension_loaded('pdo_sqlite')) {
|
||||||
throw new \PHPUnit_Framework_SkippedTestError('Extension pdo_sqlite required.');
|
self::markTestSkipped('Extension pdo_sqlite required.');
|
||||||
}
|
}
|
||||||
|
|
||||||
self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_cache');
|
self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_cache');
|
||||||
|
@ -24,7 +24,7 @@ class PdoDbalCacheTest extends CacheTestCase
|
|||||||
public static function setupBeforeClass()
|
public static function setupBeforeClass()
|
||||||
{
|
{
|
||||||
if (!extension_loaded('pdo_sqlite')) {
|
if (!extension_loaded('pdo_sqlite')) {
|
||||||
throw new \PHPUnit_Framework_SkippedTestError('Extension pdo_sqlite required.');
|
self::markTestSkipped('Extension pdo_sqlite required.');
|
||||||
}
|
}
|
||||||
|
|
||||||
self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_cache');
|
self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_cache');
|
||||||
|
@ -221,7 +221,14 @@ class ApplicationTest extends TestCase
|
|||||||
$application->add(new \Foo2Command());
|
$application->add(new \Foo2Command());
|
||||||
|
|
||||||
$expectedMsg = "The namespace \"f\" is ambiguous.\nDid you mean one of these?\n foo\n foo1";
|
$expectedMsg = "The namespace \"f\" is ambiguous.\nDid you mean one of these?\n foo\n foo1";
|
||||||
|
|
||||||
|
if (method_exists($this, 'expectException')) {
|
||||||
|
$this->expectException(CommandNotFoundException::class);
|
||||||
|
$this->expectExceptionMessage($expectedMsg);
|
||||||
|
} else {
|
||||||
$this->setExpectedException(CommandNotFoundException::class, $expectedMsg);
|
$this->setExpectedException(CommandNotFoundException::class, $expectedMsg);
|
||||||
|
}
|
||||||
|
|
||||||
$application->findNamespace('f');
|
$application->findNamespace('f');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -933,7 +933,13 @@ class ContainerBuilderTest extends TestCase
|
|||||||
$container = include __DIR__.'/Fixtures/containers/container30.php';
|
$container = include __DIR__.'/Fixtures/containers/container30.php';
|
||||||
$container->getDefinition($id)->setOverriddenGetter($getter, 123);
|
$container->getDefinition($id)->setOverriddenGetter($getter, 123);
|
||||||
|
|
||||||
|
if (method_exists($this, 'expectException')) {
|
||||||
|
$this->expectException(RuntimeException::class);
|
||||||
|
$this->expectExceptionMessage($expectedMessage);
|
||||||
|
} else {
|
||||||
$this->setExpectedException(RuntimeException::class, $expectedMessage);
|
$this->setExpectedException(RuntimeException::class, $expectedMessage);
|
||||||
|
}
|
||||||
|
|
||||||
$container->get($id);
|
$container->get($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -388,7 +388,13 @@ class PhpDumperTest extends TestCase
|
|||||||
$container->compile();
|
$container->compile();
|
||||||
$dumper = new PhpDumper($container);
|
$dumper = new PhpDumper($container);
|
||||||
|
|
||||||
|
if (method_exists($this, 'expectException')) {
|
||||||
|
$this->expectException(RuntimeException::class);
|
||||||
|
$this->expectExceptionMessage($expectedMessage);
|
||||||
|
} else {
|
||||||
$this->setExpectedException(RuntimeException::class, $expectedMessage);
|
$this->setExpectedException(RuntimeException::class, $expectedMessage);
|
||||||
|
}
|
||||||
|
|
||||||
$dumper->dump();
|
$dumper->dump();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\ExpressionLanguage\Tests;
|
namespace Symfony\Component\ExpressionLanguage\Tests;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
use Symfony\Component\ExpressionLanguage\ExpressionFunction;
|
use Symfony\Component\ExpressionLanguage\ExpressionFunction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -18,7 +19,7 @@ use Symfony\Component\ExpressionLanguage\ExpressionFunction;
|
|||||||
*
|
*
|
||||||
* @author Dany Maillard <danymaillard93b@gmail.com>
|
* @author Dany Maillard <danymaillard93b@gmail.com>
|
||||||
*/
|
*/
|
||||||
class ExpressionFunctionTest extends \PHPUnit_Framework_TestCase
|
class ExpressionFunctionTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @expectedException \InvalidArgumentException
|
* @expectedException \InvalidArgumentException
|
||||||
|
@ -36,7 +36,7 @@ class SerializerPassTest extends TestCase
|
|||||||
->with('serializer.normalizer')
|
->with('serializer.normalizer')
|
||||||
->will($this->returnValue(array()));
|
->will($this->returnValue(array()));
|
||||||
|
|
||||||
$this->setExpectedException('RuntimeException');
|
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}(\RuntimeException::class);
|
||||||
|
|
||||||
$serializerPass = new SerializerPass();
|
$serializerPass = new SerializerPass();
|
||||||
$serializerPass->process($container);
|
$serializerPass->process($container);
|
||||||
@ -63,7 +63,7 @@ class SerializerPassTest extends TestCase
|
|||||||
->method('getDefinition')
|
->method('getDefinition')
|
||||||
->will($this->returnValue($definition));
|
->will($this->returnValue($definition));
|
||||||
|
|
||||||
$this->setExpectedException('RuntimeException');
|
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}(\RuntimeException::class);
|
||||||
|
|
||||||
$serializerPass = new SerializerPass();
|
$serializerPass = new SerializerPass();
|
||||||
$serializerPass->process($container);
|
$serializerPass->process($container);
|
||||||
|
Reference in New Issue
Block a user