Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita22a9c4

Browse files
committed
Fix tests
1 parent3a626e8 commita22a9c4

File tree

11 files changed

+13
-22
lines changed

11 files changed

+13
-22
lines changed

‎src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterMappingsPassTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class RegisterMappingsPassTest extends TestCase
1515
publicfunctiontestNoDriverParmeterException()
1616
{
1717
$this->expectException('InvalidArgumentException');
18-
$this->getExpectedExceptionMessage('Could not find the manager name parameter in the container. Tried the following parameter names: "manager.param.one", "manager.param.two"');
18+
$this->expectExceptionMessage('Could not find the manager name parameter in the container. Tried the following parameter names: "manager.param.one", "manager.param.two"');
1919
$container =$this->createBuilder();
2020
$this->process($container, [
2121
'manager.param.one',

‎src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveBindingsPassTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function testUnusedBinding()
6868
publicfunctiontestMissingParent()
6969
{
7070
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
71-
$this->expectExceptionMessageRegExp('Unused binding "$quz" in service [\s\S]+ Invalid service ".*\\ParentNotExists": class NotExists not found\.');
71+
$this->expectExceptionMessageRegExp('/Unused binding "\$quz" in service [\s\S]+/');
7272
if (\PHP_VERSION_ID >=70400) {
7373
thrownewWarning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
7474
}

‎src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public function testTagWithEmptyNameThrowsException()
311311
publicfunctiontestTagWithNonStringNameThrowsException()
312312
{
313313
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
314-
$this->expectExceptionMessageRegExp('The tag name for service "\.+" must be a non-empty string');
314+
$this->expectExceptionMessageRegExp('/The tag name for service ".+"in .+must be a non-empty string/');
315315
$loader =newYamlFileLoader(newContainerBuilder(),newFileLocator(self::$fixturesPath.'/yaml'));
316316
$loader->load('tag_name_no_string.yml');
317317
}

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020

2121
class FormTest_AuthorWithoutRefSetter
2222
{
23-
use ForwardCompatTestTrait;
24-
2523
protected$reference;
2624

2725
protected$referenceCopy;
@@ -54,6 +52,8 @@ public function setReferenceCopy($reference)
5452

5553
class FormTypeTestextends BaseTypeTest
5654
{
55+
use ForwardCompatTestTrait;
56+
5757
constTESTED_TYPE ='Symfony\Component\Form\Extension\Core\Type\FormType';
5858

5959
publicfunctiontestCreateFormInstances()

‎src/Symfony/Component/Form/Tests/Resources/TranslationFilesTest.php‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,16 @@
1212
namespaceSymfony\Component\Form\Tests\Resources;
1313

1414
usePHPUnit\Framework\TestCase;
15-
useSymfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1615

1716
class TranslationFilesTestextends TestCase
1817
{
19-
use ForwardCompatTestTrait;
20-
2118
/**
2219
* @dataProvider provideTranslationFiles
2320
*/
2421
publicfunctiontestTranslationFileIsValid($filePath)
2522
{
2623
if (class_exists('PHPUnit_Util_XML')) {
27-
\PHPUnit\Util\XML::loadfile($filePath,false,false,true);
24+
\PHPUnit_Util_XML::loadfile($filePath,false,false,true);
2825
}else {
2926
\PHPUnit\Util\XML::loadfile($filePath,false,false,true);
3027
}

‎src/Symfony/Component/Lock/Tests/Store/AbstractRedisStoreTest.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111

1212
namespaceSymfony\Component\Lock\Tests\Store;
1313

14+
useSymfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1415
useSymfony\Component\Lock\Store\RedisStore;
1516

1617
/**
1718
* @author Jérémy Derussé <jeremy@derusse.com>
1819
*/
1920
abstractclass AbstractRedisStoreTestextends AbstractStoreTest
2021
{
22+
use ForwardCompatTestTrait;
2123
use ExpiringStoreTestTrait;
2224

2325
/**

‎src/Symfony/Component/Lock/Tests/Store/ExpiringStoreTestTrait.php‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
*/
2222
trait ExpiringStoreTestTrait
2323
{
24-
use ForwardCompatTestTrait;
25-
2624
/**
2725
* Amount of microseconds used as a delay to test expiration. Should be
2826
* small enough not to slow the test suite too much, and high enough not to

‎src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorCollectionTest.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ public function testIsWritableReturnsFalseIfNoAdderNorRemoverExists()
191191

192192
publicfunctiontestSetValueFailsIfAdderAndRemoverExistButValueIsNotTraversable()
193193
{
194-
$this->expectException('Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException
195-
expectedExceptionMessageRegExp /The property "axes" in class "Mock_PropertyAccessorCollectionTest_Car[^"]*" can be defined with the methods "addAxis()", "removeAxis()" but the new value must be an array or an instance of \Traversable, "string" given./');
194+
$this->expectException('Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException');
195+
$this->expectExceptionMessage('Could not determine access type for property "axes" in class "Symfony\Component\PropertyAccess\Tests\PropertyAccessorCollectionTest_Car".');
196196
$car =newPropertyAccessorCollectionTest_Car();
197197

198198
$this->propertyAccessor->setValue($car,'axes','Not an array or Traversable');

‎src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ public function testDefaultRequirementOfVariableDisallowsNextSeparator()
339339

340340
publicfunctiontestSchemeRequirement()
341341
{
342-
$this->expectException('Symfony\Component\Routing\Exception\ResourceNotFoundException');
342+
$this->getExpectedException() ?:$this->expectException('Symfony\Component\Routing\Exception\ResourceNotFoundException');
343343
$coll =newRouteCollection();
344344
$coll->add('foo',newRoute('/foo', [], [], [],'', ['https']));
345345
$matcher =$this->getUrlMatcher($coll);

‎src/Symfony/Component/Security/Core/Tests/Resources/TranslationFilesTest.php‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,16 @@
1212
namespaceSymfony\Component\Security\Core\Tests\Resources;
1313

1414
usePHPUnit\Framework\TestCase;
15-
useSymfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1615

1716
class TranslationFilesTestextends TestCase
1817
{
19-
use ForwardCompatTestTrait;
20-
2118
/**
2219
* @dataProvider provideTranslationFiles
2320
*/
2421
publicfunctiontestTranslationFileIsValid($filePath)
2522
{
2623
if (class_exists('PHPUnit_Util_XML')) {
27-
\PHPUnit\Util\XML::loadfile($filePath,false,false,true);
24+
\PHPUnit_Util_XML::loadfile($filePath,false,false,true);
2825
}else {
2926
\PHPUnit\Util\XML::loadfile($filePath,false,false,true);
3027
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp