Skip to content

Commit 62d224d

Browse files
committed
Fix tests
1 parent 3a626e8 commit 62d224d

File tree

11 files changed

+13
-13
lines changed

11 files changed

+13
-13
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
public function testNoDriverParmeterException()
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
public function testMissingParent()
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
throw new Warning('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
public function testTagWithNonStringNameThrowsException()
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 = new YamlFileLoader(new ContainerBuilder(), new FileLocator(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 FormTypeTest extends BaseTypeTest
5654
{
55+
use ForwardCompatTestTrait;
56+
5757
const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\FormType';
5858

5959
public function testCreateFormInstances()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class TranslationFilesTest extends TestCase
2424
public function testTranslationFileIsValid($filePath)
2525
{
2626
if (class_exists('PHPUnit_Util_XML')) {
27-
\PHPUnit\Util\XML::loadfile($filePath, false, false, true);
27+
PHPUnit_Util_XML::loadfile($filePath, false, false, true);
2828
} else {
2929
\PHPUnit\Util\XML::loadfile($filePath, false, false, true);
3030
}

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
namespace Symfony\Component\Lock\Tests\Store;
1313

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

1617
/**
1718
* @author Jérémy Derussé <jeremy@derusse.com>
1819
*/
1920
abstract class AbstractRedisStoreTest extends 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
public function testSetValueFailsIfAdderAndRemoverExistButValueIsNotTraversable()
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 = new PropertyAccessorCollectionTest_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
public function testSchemeRequirement()
341341
{
342-
$this->expectException('Symfony\Component\Routing\Exception\ResourceNotFoundException');
342+
$this->getExpectedException() ?: $this->expectException('Symfony\Component\Routing\Exception\ResourceNotFoundException');
343343
$coll = new RouteCollection();
344344
$coll->add('foo', new Route('/foo', [], [], [], '', ['https']));
345345
$matcher = $this->getUrlMatcher($coll);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class TranslationFilesTest extends TestCase
2424
public function testTranslationFileIsValid($filePath)
2525
{
2626
if (class_exists('PHPUnit_Util_XML')) {
27-
\PHPUnit\Util\XML::loadfile($filePath, false, false, true);
27+
PHPUnit_Util_XML::loadfile($filePath, false, false, true);
2828
} else {
2929
\PHPUnit\Util\XML::loadfile($filePath, false, false, true);
3030
}

src/Symfony/Component/Validator/Tests/Resources/TranslationFilesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class TranslationFilesTest extends TestCase
2424
public function testTranslationFileIsValid($filePath)
2525
{
2626
if (class_exists('PHPUnit_Util_XML')) {
27-
\PHPUnit\Util\XML::loadfile($filePath, false, false, true);
27+
PHPUnit_Util_XML::loadfile($filePath, false, false, true);
2828
} else {
2929
\PHPUnit\Util\XML::loadfile($filePath, false, false, true);
3030
}

0 commit comments

Comments
 (0)