Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jderusse committed Aug 1, 2019
1 parent 3a626e8 commit ae544cc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Expand Up @@ -68,7 +68,7 @@ public function testUnusedBinding()
public function testMissingParent()
{
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
$this->expectExceptionMessageRegExp('Unused binding "$quz" in service [\s\S]+ Invalid service ".*\\ParentNotExists": class NotExists not found\.');
$this->expectExceptionMessageRegExp('/Unused binding "\$quz" in service [\s\S]+/');
if (\PHP_VERSION_ID >= 70400) {
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
}
Expand Down
Expand Up @@ -311,7 +311,7 @@ public function testTagWithEmptyNameThrowsException()
public function testTagWithNonStringNameThrowsException()
{
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
$this->expectExceptionMessageRegExp('The tag name for service "\.+" must be a non-empty string');
$this->expectExceptionMessageRegExp('/The tag name for service ".+" in .+ must be a non-empty string/');
$loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml'));
$loader->load('tag_name_no_string.yml');
}
Expand Down
Expand Up @@ -191,8 +191,8 @@ public function testIsWritableReturnsFalseIfNoAdderNorRemoverExists()

public function testSetValueFailsIfAdderAndRemoverExistButValueIsNotTraversable()
{
$this->expectException('Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException
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./');
$this->expectException('Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException');
$this->expectExceptionMessage('Could not determine access type for property "axes" in class "Symfony\Component\PropertyAccess\Tests\PropertyAccessorCollectionTest_Car".');
$car = new PropertyAccessorCollectionTest_Car();

$this->propertyAccessor->setValue($car, 'axes', 'Not an array or Traversable');
Expand Down
Expand Up @@ -339,7 +339,7 @@ public function testDefaultRequirementOfVariableDisallowsNextSeparator()

public function testSchemeRequirement()
{
$this->expectException('Symfony\Component\Routing\Exception\ResourceNotFoundException');
$this->getExpectedException() ?: $this->expectException('Symfony\Component\Routing\Exception\ResourceNotFoundException');
$coll = new RouteCollection();
$coll->add('foo', new Route('/foo', [], [], [], '', ['https']));
$matcher = $this->getUrlMatcher($coll);
Expand Down

0 comments on commit ae544cc

Please sign in to comment.