[PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions
This commit is contained in:
parent
0506f8ce2b
commit
cfd5a29eaf
|
@ -118,7 +118,7 @@
|
||||||
"psr/http-client": "^1.0",
|
"psr/http-client": "^1.0",
|
||||||
"psr/simple-cache": "^1.0",
|
"psr/simple-cache": "^1.0",
|
||||||
"egulias/email-validator": "~1.2,>=1.2.8|~2.0",
|
"egulias/email-validator": "~1.2,>=1.2.8|~2.0",
|
||||||
"symfony/phpunit-bridge": "^3.4.31|^4.3.4|~5.0",
|
"symfony/phpunit-bridge": "^5.0.8",
|
||||||
"symfony/security-acl": "~2.8|~3.0",
|
"symfony/security-acl": "~2.8|~3.0",
|
||||||
"phpdocumentor/reflection-docblock": "^3.0|^4.0",
|
"phpdocumentor/reflection-docblock": "^3.0|^4.0",
|
||||||
"twig/cssinliner-extra": "^2.12",
|
"twig/cssinliner-extra": "^2.12",
|
||||||
|
|
|
@ -95,6 +95,16 @@ trait PolyfillTestCaseTrait
|
||||||
$property->setValue($this, $message);
|
$property->setValue($this, $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $messageRegExp
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function expectExceptionMessageMatches($messageRegExp)
|
||||||
|
{
|
||||||
|
$this->expectExceptionMessageRegExp($messageRegExp);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $messageRegExp
|
* @param string $messageRegExp
|
||||||
*
|
*
|
||||||
|
|
|
@ -101,7 +101,7 @@ class FilesystemLoaderTest extends TestCase
|
||||||
public function testTwigErrorIfTemplateDoesNotExist()
|
public function testTwigErrorIfTemplateDoesNotExist()
|
||||||
{
|
{
|
||||||
$this->expectException('Twig\Error\LoaderError');
|
$this->expectException('Twig\Error\LoaderError');
|
||||||
$this->expectExceptionMessageRegExp('/Unable to find template "name\.format\.engine" \(looked into: .*Tests.Loader.\.\..DependencyInjection.Fixtures.templates\)/');
|
$this->expectExceptionMessageMatches('/Unable to find template "name\.format\.engine" \(looked into: .*Tests.Loader.\.\..DependencyInjection.Fixtures.templates\)/');
|
||||||
$parser = $this->getMockBuilder('Symfony\Component\Templating\TemplateNameParserInterface')->getMock();
|
$parser = $this->getMockBuilder('Symfony\Component\Templating\TemplateNameParserInterface')->getMock();
|
||||||
$locator = $this->getMockBuilder('Symfony\Component\Config\FileLocatorInterface')->getMock();
|
$locator = $this->getMockBuilder('Symfony\Component\Config\FileLocatorInterface')->getMock();
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ class DirectoryResourceTest extends TestCase
|
||||||
public function testResourceDoesNotExist()
|
public function testResourceDoesNotExist()
|
||||||
{
|
{
|
||||||
$this->expectException('InvalidArgumentException');
|
$this->expectException('InvalidArgumentException');
|
||||||
$this->expectExceptionMessageRegExp('/The directory ".*" does not exist./');
|
$this->expectExceptionMessageMatches('/The directory ".*" does not exist./');
|
||||||
new DirectoryResource('/____foo/foobar'.mt_rand(1, 999999));
|
new DirectoryResource('/____foo/foobar'.mt_rand(1, 999999));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ class FileResourceTest extends TestCase
|
||||||
public function testResourceDoesNotExist()
|
public function testResourceDoesNotExist()
|
||||||
{
|
{
|
||||||
$this->expectException('InvalidArgumentException');
|
$this->expectException('InvalidArgumentException');
|
||||||
$this->expectExceptionMessageRegExp('/The file ".*" does not exist./');
|
$this->expectExceptionMessageMatches('/The file ".*" does not exist./');
|
||||||
new FileResource('/____foo/foobar'.mt_rand(1, 999999));
|
new FileResource('/____foo/foobar'.mt_rand(1, 999999));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -400,7 +400,7 @@ class ResolveChildDefinitionsPassTest extends TestCase
|
||||||
public function testProcessDetectsChildDefinitionIndirectCircularReference()
|
public function testProcessDetectsChildDefinitionIndirectCircularReference()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException');
|
$this->expectException('Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException');
|
||||||
$this->expectExceptionMessageRegExp('/^Circular reference detected for service "c", path: "c -> b -> a -> c"./');
|
$this->expectExceptionMessageMatches('/^Circular reference detected for service "c", path: "c -> b -> a -> c"./');
|
||||||
$container = new ContainerBuilder();
|
$container = new ContainerBuilder();
|
||||||
|
|
||||||
$container->register('a');
|
$container->register('a');
|
||||||
|
|
|
@ -233,7 +233,7 @@ class ResolveInstanceofConditionalsPassTest extends TestCase
|
||||||
public function testProcessThrowsExceptionForArguments()
|
public function testProcessThrowsExceptionForArguments()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
||||||
$this->expectExceptionMessageRegExp('/Autoconfigured instanceof for type "PHPUnit[\\\\_]Framework[\\\\_]TestCase" defines arguments but these are not supported and should be removed\./');
|
$this->expectExceptionMessageMatches('/Autoconfigured instanceof for type "PHPUnit[\\\\_]Framework[\\\\_]TestCase" defines arguments but these are not supported and should be removed\./');
|
||||||
$container = new ContainerBuilder();
|
$container = new ContainerBuilder();
|
||||||
$container->registerForAutoconfiguration(parent::class)
|
$container->registerForAutoconfiguration(parent::class)
|
||||||
->addArgument('bar');
|
->addArgument('bar');
|
||||||
|
|
|
@ -105,7 +105,7 @@ class ValidateEnvPlaceholdersPassTest extends TestCase
|
||||||
public function testNulledEnvInConfig()
|
public function testNulledEnvInConfig()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\Config\Definition\Exception\InvalidTypeException');
|
$this->expectException('Symfony\Component\Config\Definition\Exception\InvalidTypeException');
|
||||||
$this->expectExceptionMessageRegexp('/^Invalid type for path "env_extension\.int_node"\. Expected "?int"?, but got (NULL|"null")\.$/');
|
$this->expectExceptionMessageMatches('/^Invalid type for path "env_extension\.int_node"\. Expected "?int"?, but got (NULL|"null")\.$/');
|
||||||
$container = new ContainerBuilder();
|
$container = new ContainerBuilder();
|
||||||
$container->setParameter('env(NULLED)', null);
|
$container->setParameter('env(NULLED)', null);
|
||||||
$container->registerExtension(new EnvExtension());
|
$container->registerExtension(new EnvExtension());
|
||||||
|
|
|
@ -216,7 +216,7 @@ class FileLoaderTest extends TestCase
|
||||||
public function testRegisterClassesWithBadPrefix()
|
public function testRegisterClassesWithBadPrefix()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
||||||
$this->expectExceptionMessageRegExp('/Expected to find class "Symfony\\\Component\\\DependencyInjection\\\Tests\\\Fixtures\\\Prototype\\\Bar" in file ".+" while importing services from resource "Prototype\/Sub\/\*", but it was not found\! Check the namespace prefix used with the resource/');
|
$this->expectExceptionMessageMatches('/Expected to find class "Symfony\\\Component\\\DependencyInjection\\\Tests\\\Fixtures\\\Prototype\\\Bar" in file ".+" while importing services from resource "Prototype\/Sub\/\*", but it was not found\! Check the namespace prefix used with the resource/');
|
||||||
$container = new ContainerBuilder();
|
$container = new ContainerBuilder();
|
||||||
$loader = new TestFileLoader($container, new FileLocator(self::$fixturesPath.'/Fixtures'));
|
$loader = new TestFileLoader($container, new FileLocator(self::$fixturesPath.'/Fixtures'));
|
||||||
|
|
||||||
|
|
|
@ -378,7 +378,7 @@ class XmlFileLoaderTest extends TestCase
|
||||||
public function testParseTagWithEmptyNameThrowsException()
|
public function testParseTagWithEmptyNameThrowsException()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
||||||
$this->expectExceptionMessageRegExp('/The tag name for service ".+" in .* must be a non-empty string/');
|
$this->expectExceptionMessageMatches('/The tag name for service ".+" in .* must be a non-empty string/');
|
||||||
$container = new ContainerBuilder();
|
$container = new ContainerBuilder();
|
||||||
$loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml'));
|
$loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml'));
|
||||||
$loader->load('tag_with_empty_name.xml');
|
$loader->load('tag_with_empty_name.xml');
|
||||||
|
|
|
@ -50,7 +50,7 @@ class YamlFileLoaderTest extends TestCase
|
||||||
public function testLoadUnExistFile()
|
public function testLoadUnExistFile()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
||||||
$this->expectExceptionMessageRegExp('/The file ".+" does not exist./');
|
$this->expectExceptionMessageMatches('/The file ".+" does not exist./');
|
||||||
$loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/ini'));
|
$loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/ini'));
|
||||||
$r = new \ReflectionObject($loader);
|
$r = new \ReflectionObject($loader);
|
||||||
$m = $r->getMethod('loadFile');
|
$m = $r->getMethod('loadFile');
|
||||||
|
@ -62,7 +62,7 @@ class YamlFileLoaderTest extends TestCase
|
||||||
public function testLoadInvalidYamlFile()
|
public function testLoadInvalidYamlFile()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
||||||
$this->expectExceptionMessageRegExp('/The file ".+" does not contain valid YAML./');
|
$this->expectExceptionMessageMatches('/The file ".+" does not contain valid YAML./');
|
||||||
$path = self::$fixturesPath.'/ini';
|
$path = self::$fixturesPath.'/ini';
|
||||||
$loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator($path));
|
$loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator($path));
|
||||||
$r = new \ReflectionObject($loader);
|
$r = new \ReflectionObject($loader);
|
||||||
|
@ -384,7 +384,7 @@ class YamlFileLoaderTest extends TestCase
|
||||||
public function testTagWithEmptyNameThrowsException()
|
public function testTagWithEmptyNameThrowsException()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
||||||
$this->expectExceptionMessageRegExp('/The tag name for service ".+" in .+ must be a non-empty string/');
|
$this->expectExceptionMessageMatches('/The tag name for service ".+" in .+ must be a non-empty string/');
|
||||||
$loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml'));
|
$loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml'));
|
||||||
$loader->load('tag_name_empty_string.yml');
|
$loader->load('tag_name_empty_string.yml');
|
||||||
}
|
}
|
||||||
|
@ -392,7 +392,7 @@ class YamlFileLoaderTest extends TestCase
|
||||||
public function testTagWithNonStringNameThrowsException()
|
public function testTagWithNonStringNameThrowsException()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
||||||
$this->expectExceptionMessageRegExp('/The tag name for service ".+" in .+ must be a non-empty string/');
|
$this->expectExceptionMessageMatches('/The tag name for service ".+" in .+ must be a non-empty string/');
|
||||||
$loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml'));
|
$loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml'));
|
||||||
$loader->load('tag_name_no_string.yml');
|
$loader->load('tag_name_no_string.yml');
|
||||||
}
|
}
|
||||||
|
@ -493,7 +493,7 @@ class YamlFileLoaderTest extends TestCase
|
||||||
public function testPrototypeWithNamespaceAndNoResource()
|
public function testPrototypeWithNamespaceAndNoResource()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
||||||
$this->expectExceptionMessageRegExp('/A "resource" attribute must be set when the "namespace" attribute is set for service ".+" in .+/');
|
$this->expectExceptionMessageMatches('/A "resource" attribute must be set when the "namespace" attribute is set for service ".+" in .+/');
|
||||||
$container = new ContainerBuilder();
|
$container = new ContainerBuilder();
|
||||||
$loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml'));
|
$loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml'));
|
||||||
$loader->load('services_prototype_namespace_without_resource.yml');
|
$loader->load('services_prototype_namespace_without_resource.yml');
|
||||||
|
@ -621,7 +621,7 @@ class YamlFileLoaderTest extends TestCase
|
||||||
public function testInvalidTagsWithDefaults()
|
public function testInvalidTagsWithDefaults()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
||||||
$this->expectExceptionMessageRegExp('/Parameter "tags" must be an array for service "Foo\\\Bar" in ".+services31_invalid_tags\.yml"\. Check your YAML syntax./');
|
$this->expectExceptionMessageMatches('/Parameter "tags" must be an array for service "Foo\\\Bar" in ".+services31_invalid_tags\.yml"\. Check your YAML syntax./');
|
||||||
$loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml'));
|
$loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml'));
|
||||||
$loader->load('services31_invalid_tags.yml');
|
$loader->load('services31_invalid_tags.yml');
|
||||||
}
|
}
|
||||||
|
@ -711,7 +711,7 @@ class YamlFileLoaderTest extends TestCase
|
||||||
public function testAnonymousServicesWithAliases()
|
public function testAnonymousServicesWithAliases()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
||||||
$this->expectExceptionMessageRegExp('/Creating an alias using the tag "!service" is not allowed in ".+anonymous_services_alias\.yml"\./');
|
$this->expectExceptionMessageMatches('/Creating an alias using the tag "!service" is not allowed in ".+anonymous_services_alias\.yml"\./');
|
||||||
$container = new ContainerBuilder();
|
$container = new ContainerBuilder();
|
||||||
$loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml'));
|
$loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml'));
|
||||||
$loader->load('anonymous_services_alias.yml');
|
$loader->load('anonymous_services_alias.yml');
|
||||||
|
@ -720,7 +720,7 @@ class YamlFileLoaderTest extends TestCase
|
||||||
public function testAnonymousServicesInParameters()
|
public function testAnonymousServicesInParameters()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
||||||
$this->expectExceptionMessageRegExp('/Using an anonymous service in a parameter is not allowed in ".+anonymous_services_in_parameters\.yml"\./');
|
$this->expectExceptionMessageMatches('/Using an anonymous service in a parameter is not allowed in ".+anonymous_services_in_parameters\.yml"\./');
|
||||||
$container = new ContainerBuilder();
|
$container = new ContainerBuilder();
|
||||||
$loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml'));
|
$loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml'));
|
||||||
$loader->load('anonymous_services_in_parameters.yml');
|
$loader->load('anonymous_services_in_parameters.yml');
|
||||||
|
@ -739,7 +739,7 @@ class YamlFileLoaderTest extends TestCase
|
||||||
public function testEmptyDefaultsThrowsClearException()
|
public function testEmptyDefaultsThrowsClearException()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
||||||
$this->expectExceptionMessageRegExp('/Service "_defaults" key must be an array, "NULL" given in ".+bad_empty_defaults\.yml"\./');
|
$this->expectExceptionMessageMatches('/Service "_defaults" key must be an array, "NULL" given in ".+bad_empty_defaults\.yml"\./');
|
||||||
$container = new ContainerBuilder();
|
$container = new ContainerBuilder();
|
||||||
$loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml'));
|
$loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml'));
|
||||||
$loader->load('bad_empty_defaults.yml');
|
$loader->load('bad_empty_defaults.yml');
|
||||||
|
@ -748,7 +748,7 @@ class YamlFileLoaderTest extends TestCase
|
||||||
public function testEmptyInstanceofThrowsClearException()
|
public function testEmptyInstanceofThrowsClearException()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
||||||
$this->expectExceptionMessageRegExp('/Service "_instanceof" key must be an array, "NULL" given in ".+bad_empty_instanceof\.yml"\./');
|
$this->expectExceptionMessageMatches('/Service "_instanceof" key must be an array, "NULL" given in ".+bad_empty_instanceof\.yml"\./');
|
||||||
$container = new ContainerBuilder();
|
$container = new ContainerBuilder();
|
||||||
$loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml'));
|
$loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml'));
|
||||||
$loader->load('bad_empty_instanceof.yml');
|
$loader->load('bad_empty_instanceof.yml');
|
||||||
|
@ -757,7 +757,7 @@ class YamlFileLoaderTest extends TestCase
|
||||||
public function testUnsupportedKeywordThrowsException()
|
public function testUnsupportedKeywordThrowsException()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
||||||
$this->expectExceptionMessageRegExp('/^The configuration key "private" is unsupported for definition "bar"/');
|
$this->expectExceptionMessageMatches('/^The configuration key "private" is unsupported for definition "bar"/');
|
||||||
$container = new ContainerBuilder();
|
$container = new ContainerBuilder();
|
||||||
$loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml'));
|
$loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml'));
|
||||||
$loader->load('bad_keyword.yml');
|
$loader->load('bad_keyword.yml');
|
||||||
|
@ -766,7 +766,7 @@ class YamlFileLoaderTest extends TestCase
|
||||||
public function testUnsupportedKeywordInServiceAliasThrowsException()
|
public function testUnsupportedKeywordInServiceAliasThrowsException()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
|
||||||
$this->expectExceptionMessageRegExp('/^The configuration key "calls" is unsupported for the service "bar" which is defined as an alias/');
|
$this->expectExceptionMessageMatches('/^The configuration key "calls" is unsupported for the service "bar" which is defined as an alias/');
|
||||||
$container = new ContainerBuilder();
|
$container = new ContainerBuilder();
|
||||||
$loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml'));
|
$loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml'));
|
||||||
$loader->load('bad_alias.yml');
|
$loader->load('bad_alias.yml');
|
||||||
|
|
|
@ -231,7 +231,7 @@ class ExpressionLanguageTest extends TestCase
|
||||||
public function testCallBadCallable()
|
public function testCallBadCallable()
|
||||||
{
|
{
|
||||||
$this->expectException('RuntimeException');
|
$this->expectException('RuntimeException');
|
||||||
$this->expectExceptionMessageRegExp('/Unable to call method "\w+" of object "\w+"./');
|
$this->expectExceptionMessageMatches('/Unable to call method "\w+" of object "\w+"./');
|
||||||
$el = new ExpressionLanguage();
|
$el = new ExpressionLanguage();
|
||||||
$el->evaluate('foo.myfunction()', ['foo' => new \stdClass()]);
|
$el->evaluate('foo.myfunction()', ['foo' => new \stdClass()]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,7 +197,7 @@ class CheckboxTypeTest extends BaseTypeTest
|
||||||
public function testDontAllowNonArrayFalseValues()
|
public function testDontAllowNonArrayFalseValues()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\OptionsResolver\Exception\InvalidOptionsException');
|
$this->expectException('Symfony\Component\OptionsResolver\Exception\InvalidOptionsException');
|
||||||
$this->expectExceptionMessageRegExp('/"false_values" with value "invalid" is expected to be of type "array"/');
|
$this->expectExceptionMessageMatches('/"false_values" with value "invalid" is expected to be of type "array"/');
|
||||||
$this->factory->create(static::TESTED_TYPE, null, [
|
$this->factory->create(static::TESTED_TYPE, null, [
|
||||||
'false_values' => 'invalid',
|
'false_values' => 'invalid',
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -19,7 +19,7 @@ class SocketStreamTest extends TestCase
|
||||||
public function testSocketErrorNoConnection()
|
public function testSocketErrorNoConnection()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\Mailer\Exception\TransportException');
|
$this->expectException('Symfony\Component\Mailer\Exception\TransportException');
|
||||||
$this->expectExceptionMessageRegExp('/Connection refused|unable to connect/');
|
$this->expectExceptionMessageMatches('/Connection refused|unable to connect/');
|
||||||
$s = new SocketStream();
|
$s = new SocketStream();
|
||||||
$s->setTimeout(0.1);
|
$s->setTimeout(0.1);
|
||||||
$s->setPort(9999);
|
$s->setPort(9999);
|
||||||
|
@ -29,7 +29,7 @@ class SocketStreamTest extends TestCase
|
||||||
public function testSocketErrorBeforeConnectError()
|
public function testSocketErrorBeforeConnectError()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\Mailer\Exception\TransportException');
|
$this->expectException('Symfony\Component\Mailer\Exception\TransportException');
|
||||||
$this->expectExceptionMessageRegExp('/no valid certs found cafile stream|Unable to find the socket transport "ssl"/');
|
$this->expectExceptionMessageMatches('/no valid certs found cafile stream|Unable to find the socket transport "ssl"/');
|
||||||
$s = new SocketStream();
|
$s = new SocketStream();
|
||||||
$s->setStreamOptions([
|
$s->setStreamOptions([
|
||||||
'ssl' => [
|
'ssl' => [
|
||||||
|
|
|
@ -44,7 +44,7 @@ class PhpSerializerTest extends TestCase
|
||||||
public function testDecodingFailsWithBadFormat()
|
public function testDecodingFailsWithBadFormat()
|
||||||
{
|
{
|
||||||
$this->expectException(MessageDecodingFailedException::class);
|
$this->expectException(MessageDecodingFailedException::class);
|
||||||
$this->expectExceptionMessageRegExp('/Could not decode/');
|
$this->expectExceptionMessageMatches('/Could not decode/');
|
||||||
|
|
||||||
$serializer = new PhpSerializer();
|
$serializer = new PhpSerializer();
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ class PhpSerializerTest extends TestCase
|
||||||
public function testDecodingFailsWithBadClass()
|
public function testDecodingFailsWithBadClass()
|
||||||
{
|
{
|
||||||
$this->expectException(MessageDecodingFailedException::class);
|
$this->expectException(MessageDecodingFailedException::class);
|
||||||
$this->expectExceptionMessageRegExp('/class "ReceivedSt0mp" not found/');
|
$this->expectExceptionMessageMatches('/class "ReceivedSt0mp" not found/');
|
||||||
|
|
||||||
$serializer = new PhpSerializer();
|
$serializer = new PhpSerializer();
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ class ProcessTest extends TestCase
|
||||||
public function testInvalidCwd()
|
public function testInvalidCwd()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\Process\Exception\RuntimeException');
|
$this->expectException('Symfony\Component\Process\Exception\RuntimeException');
|
||||||
$this->expectExceptionMessageRegExp('/The provided cwd ".*" does not exist\./');
|
$this->expectExceptionMessageMatches('/The provided cwd ".*" does not exist\./');
|
||||||
try {
|
try {
|
||||||
// Check that it works fine if the CWD exists
|
// Check that it works fine if the CWD exists
|
||||||
$cmd = new Process(['echo', 'test'], __DIR__);
|
$cmd = new Process(['echo', 'test'], __DIR__);
|
||||||
|
|
|
@ -149,7 +149,7 @@ abstract class PropertyAccessorCollectionTest extends PropertyAccessorArrayAcces
|
||||||
public function testSetValueFailsIfNoAdderNorRemoverFound()
|
public function testSetValueFailsIfNoAdderNorRemoverFound()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException');
|
$this->expectException('Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException');
|
||||||
$this->expectExceptionMessageRegExp('/Could not determine access type for property "axes" in class "Mock_PropertyAccessorCollectionTest_CarNoAdderAndRemover_[^"]*"./');
|
$this->expectExceptionMessageMatches('/Could not determine access type for property "axes" in class "Mock_PropertyAccessorCollectionTest_CarNoAdderAndRemover_[^"]*"./');
|
||||||
$car = $this->getMockBuilder(__CLASS__.'_CarNoAdderAndRemover')->getMock();
|
$car = $this->getMockBuilder(__CLASS__.'_CarNoAdderAndRemover')->getMock();
|
||||||
$axesBefore = $this->getContainer([1 => 'second', 3 => 'fourth']);
|
$axesBefore = $this->getContainer([1 => 'second', 3 => 'fourth']);
|
||||||
$axesAfter = $this->getContainer([0 => 'first', 1 => 'second', 2 => 'third']);
|
$axesAfter = $this->getContainer([0 => 'first', 1 => 'second', 2 => 'third']);
|
||||||
|
@ -188,7 +188,7 @@ abstract class PropertyAccessorCollectionTest extends PropertyAccessorArrayAcces
|
||||||
public function testSetValueFailsIfAdderAndRemoverExistButValueIsNotTraversable()
|
public function testSetValueFailsIfAdderAndRemoverExistButValueIsNotTraversable()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException');
|
$this->expectException('Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException');
|
||||||
$this->expectExceptionMessageRegExp('/Could not determine access type for property "axes" in class "Symfony\\\\Component\\\\PropertyAccess\\\\Tests\\\\PropertyAccessorCollectionTest_Car[^"]*": The property "axes" in class "Symfony\\\\Component\\\\PropertyAccess\\\\Tests\\\\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->expectExceptionMessageMatches('/Could not determine access type for property "axes" in class "Symfony\\\\Component\\\\PropertyAccess\\\\Tests\\\\PropertyAccessorCollectionTest_Car[^"]*": The property "axes" in class "Symfony\\\\Component\\\\PropertyAccess\\\\Tests\\\\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./');
|
||||||
$car = new PropertyAccessorCollectionTest_Car();
|
$car = new PropertyAccessorCollectionTest_Car();
|
||||||
|
|
||||||
$this->propertyAccessor->setValue($car, 'axes', 'Not an array or Traversable');
|
$this->propertyAccessor->setValue($car, 'axes', 'Not an array or Traversable');
|
||||||
|
|
|
@ -768,7 +768,7 @@ class PropertyAccessorTest extends TestCase
|
||||||
public function testAdderWithoutRemover()
|
public function testAdderWithoutRemover()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException');
|
$this->expectException('Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException');
|
||||||
$this->expectExceptionMessageRegExp('/.*The add method "addFoo" in class "Symfony\\\Component\\\PropertyAccess\\\Tests\\\Fixtures\\\TestAdderRemoverInvalidMethods" was found, but the corresponding remove method "removeFoo" was not found\./');
|
$this->expectExceptionMessageMatches('/.*The add method "addFoo" in class "Symfony\\\Component\\\PropertyAccess\\\Tests\\\Fixtures\\\TestAdderRemoverInvalidMethods" was found, but the corresponding remove method "removeFoo" was not found\./');
|
||||||
$object = new TestAdderRemoverInvalidMethods();
|
$object = new TestAdderRemoverInvalidMethods();
|
||||||
$this->propertyAccessor->setValue($object, 'foos', [1, 2]);
|
$this->propertyAccessor->setValue($object, 'foos', [1, 2]);
|
||||||
}
|
}
|
||||||
|
@ -776,7 +776,7 @@ class PropertyAccessorTest extends TestCase
|
||||||
public function testRemoverWithoutAdder()
|
public function testRemoverWithoutAdder()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException');
|
$this->expectException('Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException');
|
||||||
$this->expectExceptionMessageRegExp('/.*The remove method "removeBar" in class "Symfony\\\Component\\\PropertyAccess\\\Tests\\\Fixtures\\\TestAdderRemoverInvalidMethods" was found, but the corresponding add method "addBar" was not found\./');
|
$this->expectExceptionMessageMatches('/.*The remove method "removeBar" in class "Symfony\\\Component\\\PropertyAccess\\\Tests\\\Fixtures\\\TestAdderRemoverInvalidMethods" was found, but the corresponding add method "addBar" was not found\./');
|
||||||
$object = new TestAdderRemoverInvalidMethods();
|
$object = new TestAdderRemoverInvalidMethods();
|
||||||
$this->propertyAccessor->setValue($object, 'bars', [1, 2]);
|
$this->propertyAccessor->setValue($object, 'bars', [1, 2]);
|
||||||
}
|
}
|
||||||
|
@ -784,7 +784,7 @@ class PropertyAccessorTest extends TestCase
|
||||||
public function testAdderAndRemoveNeedsTheExactParametersDefined()
|
public function testAdderAndRemoveNeedsTheExactParametersDefined()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException');
|
$this->expectException('Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException');
|
||||||
$this->expectExceptionMessageRegExp('/.*The method "addFoo" in class "Symfony\\\Component\\\PropertyAccess\\\Tests\\\Fixtures\\\TestAdderRemoverInvalidArgumentLength" requires 0 arguments, but should accept only 1\. The method "removeFoo" in class "Symfony\\\Component\\\PropertyAccess\\\Tests\\\Fixtures\\\TestAdderRemoverInvalidArgumentLength" requires 2 arguments, but should accept only 1\./');
|
$this->expectExceptionMessageMatches('/.*The method "addFoo" in class "Symfony\\\Component\\\PropertyAccess\\\Tests\\\Fixtures\\\TestAdderRemoverInvalidArgumentLength" requires 0 arguments, but should accept only 1\. The method "removeFoo" in class "Symfony\\\Component\\\PropertyAccess\\\Tests\\\Fixtures\\\TestAdderRemoverInvalidArgumentLength" requires 2 arguments, but should accept only 1\./');
|
||||||
$object = new TestAdderRemoverInvalidArgumentLength();
|
$object = new TestAdderRemoverInvalidArgumentLength();
|
||||||
$this->propertyAccessor->setValue($object, 'foo', [1, 2]);
|
$this->propertyAccessor->setValue($object, 'foo', [1, 2]);
|
||||||
}
|
}
|
||||||
|
@ -792,7 +792,7 @@ class PropertyAccessorTest extends TestCase
|
||||||
public function testSetterNeedsTheExactParametersDefined()
|
public function testSetterNeedsTheExactParametersDefined()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException');
|
$this->expectException('Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException');
|
||||||
$this->expectExceptionMessageRegExp('/.*The method "setBar" in class "Symfony\\\Component\\\PropertyAccess\\\Tests\\\Fixtures\\\TestAdderRemoverInvalidArgumentLength" requires 2 arguments, but should accept only 1\./');
|
$this->expectExceptionMessageMatches('/.*The method "setBar" in class "Symfony\\\Component\\\PropertyAccess\\\Tests\\\Fixtures\\\TestAdderRemoverInvalidArgumentLength" requires 2 arguments, but should accept only 1\./');
|
||||||
$object = new TestAdderRemoverInvalidArgumentLength();
|
$object = new TestAdderRemoverInvalidArgumentLength();
|
||||||
$this->propertyAccessor->setValue($object, 'bar', [1, 2]);
|
$this->propertyAccessor->setValue($object, 'bar', [1, 2]);
|
||||||
}
|
}
|
||||||
|
@ -800,7 +800,7 @@ class PropertyAccessorTest extends TestCase
|
||||||
public function testSetterNeedsPublicAccess()
|
public function testSetterNeedsPublicAccess()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException');
|
$this->expectException('Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException');
|
||||||
$this->expectExceptionMessageRegExp('/.*The method "setFoo" in class "Symfony\\\Component\\\PropertyAccess\\\Tests\\\Fixtures\\\TestClassSetValue" was found but does not have public access./');
|
$this->expectExceptionMessageMatches('/.*The method "setFoo" in class "Symfony\\\Component\\\PropertyAccess\\\Tests\\\Fixtures\\\TestClassSetValue" was found but does not have public access./');
|
||||||
$object = new TestClassSetValue(0);
|
$object = new TestClassSetValue(0);
|
||||||
$this->propertyAccessor->setValue($object, 'foo', 1);
|
$this->propertyAccessor->setValue($object, 'foo', 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -439,7 +439,7 @@ class XmlFileLoaderTest extends TestCase
|
||||||
public function testOverrideControllerInDefaults()
|
public function testOverrideControllerInDefaults()
|
||||||
{
|
{
|
||||||
$this->expectException('InvalidArgumentException');
|
$this->expectException('InvalidArgumentException');
|
||||||
$this->expectExceptionMessageRegExp('/The routing file "[^"]*" must not specify both the "controller" attribute and the defaults key "_controller" for "app_blog"/');
|
$this->expectExceptionMessageMatches('/The routing file "[^"]*" must not specify both the "controller" attribute and the defaults key "_controller" for "app_blog"/');
|
||||||
$loader = new XmlFileLoader(new FileLocator([__DIR__.'/../Fixtures/controller']));
|
$loader = new XmlFileLoader(new FileLocator([__DIR__.'/../Fixtures/controller']));
|
||||||
$loader->load('override_defaults.xml');
|
$loader->load('override_defaults.xml');
|
||||||
}
|
}
|
||||||
|
@ -471,7 +471,7 @@ class XmlFileLoaderTest extends TestCase
|
||||||
public function testImportWithOverriddenController()
|
public function testImportWithOverriddenController()
|
||||||
{
|
{
|
||||||
$this->expectException('InvalidArgumentException');
|
$this->expectException('InvalidArgumentException');
|
||||||
$this->expectExceptionMessageRegExp('/The routing file "[^"]*" must not specify both the "controller" attribute and the defaults key "_controller" for the "import" tag/');
|
$this->expectExceptionMessageMatches('/The routing file "[^"]*" must not specify both the "controller" attribute and the defaults key "_controller" for the "import" tag/');
|
||||||
$loader = new XmlFileLoader(new FileLocator([__DIR__.'/../Fixtures/controller']));
|
$loader = new XmlFileLoader(new FileLocator([__DIR__.'/../Fixtures/controller']));
|
||||||
$loader->load('import_override_defaults.xml');
|
$loader->load('import_override_defaults.xml');
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,7 @@ class YamlFileLoaderTest extends TestCase
|
||||||
public function testOverrideControllerInDefaults()
|
public function testOverrideControllerInDefaults()
|
||||||
{
|
{
|
||||||
$this->expectException('InvalidArgumentException');
|
$this->expectException('InvalidArgumentException');
|
||||||
$this->expectExceptionMessageRegExp('/The routing file "[^"]*" must not specify both the "controller" key and the defaults key "_controller" for "app_blog"/');
|
$this->expectExceptionMessageMatches('/The routing file "[^"]*" must not specify both the "controller" key and the defaults key "_controller" for "app_blog"/');
|
||||||
$loader = new YamlFileLoader(new FileLocator([__DIR__.'/../Fixtures/controller']));
|
$loader = new YamlFileLoader(new FileLocator([__DIR__.'/../Fixtures/controller']));
|
||||||
$loader->load('override_defaults.yml');
|
$loader->load('override_defaults.yml');
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ class YamlFileLoaderTest extends TestCase
|
||||||
public function testImportWithOverriddenController()
|
public function testImportWithOverriddenController()
|
||||||
{
|
{
|
||||||
$this->expectException('InvalidArgumentException');
|
$this->expectException('InvalidArgumentException');
|
||||||
$this->expectExceptionMessageRegExp('/The routing file "[^"]*" must not specify both the "controller" key and the defaults key "_controller" for "_static"/');
|
$this->expectExceptionMessageMatches('/The routing file "[^"]*" must not specify both the "controller" key and the defaults key "_controller" for "_static"/');
|
||||||
$loader = new YamlFileLoader(new FileLocator([__DIR__.'/../Fixtures/controller']));
|
$loader = new YamlFileLoader(new FileLocator([__DIR__.'/../Fixtures/controller']));
|
||||||
$loader->load('import_override_defaults.yml');
|
$loader->load('import_override_defaults.yml');
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,7 +190,7 @@ class GuardAuthenticationProviderTest extends TestCase
|
||||||
public function testAuthenticateFailsOnNonOriginatingToken()
|
public function testAuthenticateFailsOnNonOriginatingToken()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\Security\Core\Exception\AuthenticationException');
|
$this->expectException('Symfony\Component\Security\Core\Exception\AuthenticationException');
|
||||||
$this->expectExceptionMessageRegExp('/second_firewall_0/');
|
$this->expectExceptionMessageMatches('/second_firewall_0/');
|
||||||
$authenticatorA = $this->getMockBuilder(AuthenticatorInterface::class)->getMock();
|
$authenticatorA = $this->getMockBuilder(AuthenticatorInterface::class)->getMock();
|
||||||
$authenticators = [$authenticatorA];
|
$authenticators = [$authenticatorA];
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ class InstantiatorTest extends TestCase
|
||||||
public function testFailingInstantiation(string $class)
|
public function testFailingInstantiation(string $class)
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\VarExporter\Exception\NotInstantiableTypeException');
|
$this->expectException('Symfony\Component\VarExporter\Exception\NotInstantiableTypeException');
|
||||||
$this->expectExceptionMessageRegExp('/Type ".*" is not instantiable\./');
|
$this->expectExceptionMessageMatches('/Type ".*" is not instantiable\./');
|
||||||
Instantiator::instantiate($class);
|
Instantiator::instantiate($class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ class VarExporterTest extends TestCase
|
||||||
public function testFailingSerialization($value)
|
public function testFailingSerialization($value)
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\VarExporter\Exception\NotInstantiableTypeException');
|
$this->expectException('Symfony\Component\VarExporter\Exception\NotInstantiableTypeException');
|
||||||
$this->expectExceptionMessageRegExp('/Type ".*" is not instantiable\./');
|
$this->expectExceptionMessageMatches('/Type ".*" is not instantiable\./');
|
||||||
$expectedDump = $this->getDump($value);
|
$expectedDump = $this->getDump($value);
|
||||||
try {
|
try {
|
||||||
VarExporter::export($value);
|
VarExporter::export($value);
|
||||||
|
|
|
@ -74,7 +74,7 @@ class InlineTest extends TestCase
|
||||||
public function testParsePhpConstantThrowsExceptionOnInvalidType()
|
public function testParsePhpConstantThrowsExceptionOnInvalidType()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\Yaml\Exception\ParseException');
|
$this->expectException('Symfony\Component\Yaml\Exception\ParseException');
|
||||||
$this->expectExceptionMessageRegExp('#The string "!php/const PHP_INT_MAX" could not be parsed as a constant.*#');
|
$this->expectExceptionMessageMatches('#The string "!php/const PHP_INT_MAX" could not be parsed as a constant.*#');
|
||||||
Inline::parse('!php/const PHP_INT_MAX', Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE);
|
Inline::parse('!php/const PHP_INT_MAX', Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -599,7 +599,7 @@ class InlineTest extends TestCase
|
||||||
public function testParseInvalidBinaryData($data, $expectedMessage)
|
public function testParseInvalidBinaryData($data, $expectedMessage)
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\Yaml\Exception\ParseException');
|
$this->expectException('Symfony\Component\Yaml\Exception\ParseException');
|
||||||
$this->expectExceptionMessageRegExp($expectedMessage);
|
$this->expectExceptionMessageMatches($expectedMessage);
|
||||||
|
|
||||||
Inline::parse($data);
|
Inline::parse($data);
|
||||||
}
|
}
|
||||||
|
@ -787,7 +787,7 @@ class InlineTest extends TestCase
|
||||||
public function testUnquotedExclamationMarkThrows(string $value)
|
public function testUnquotedExclamationMarkThrows(string $value)
|
||||||
{
|
{
|
||||||
$this->expectException(ParseException::class);
|
$this->expectException(ParseException::class);
|
||||||
$this->expectExceptionMessageRegExp('/^Using the unquoted scalar value "!" is not supported\. You must quote it at line 1 \(near "/');
|
$this->expectExceptionMessageMatches('/^Using the unquoted scalar value "!" is not supported\. You must quote it at line 1 \(near "/');
|
||||||
|
|
||||||
Inline::parse($value);
|
Inline::parse($value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -602,7 +602,7 @@ EOF;
|
||||||
public function testMultipleDocumentsNotSupportedException()
|
public function testMultipleDocumentsNotSupportedException()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\Yaml\Exception\ParseException');
|
$this->expectException('Symfony\Component\Yaml\Exception\ParseException');
|
||||||
$this->expectExceptionMessageRegExp('/^Multiple documents are not supported.+/');
|
$this->expectExceptionMessageMatches('/^Multiple documents are not supported.+/');
|
||||||
Yaml::parse(<<<'EOL'
|
Yaml::parse(<<<'EOL'
|
||||||
# Ranking of 1998 home runs
|
# Ranking of 1998 home runs
|
||||||
---
|
---
|
||||||
|
@ -1348,7 +1348,7 @@ EOT
|
||||||
public function testParseInvalidBinaryData($data, $expectedMessage)
|
public function testParseInvalidBinaryData($data, $expectedMessage)
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\Yaml\Exception\ParseException');
|
$this->expectException('Symfony\Component\Yaml\Exception\ParseException');
|
||||||
$this->expectExceptionMessageRegExp($expectedMessage);
|
$this->expectExceptionMessageMatches($expectedMessage);
|
||||||
|
|
||||||
$this->parser->parse($data);
|
$this->parser->parse($data);
|
||||||
}
|
}
|
||||||
|
@ -2102,14 +2102,14 @@ YAML;
|
||||||
public function testParsingNonExistentFilesThrowsException()
|
public function testParsingNonExistentFilesThrowsException()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\Yaml\Exception\ParseException');
|
$this->expectException('Symfony\Component\Yaml\Exception\ParseException');
|
||||||
$this->expectExceptionMessageRegExp('#^File ".+/Fixtures/nonexistent.yml" does not exist\.$#');
|
$this->expectExceptionMessageMatches('#^File ".+/Fixtures/nonexistent.yml" does not exist\.$#');
|
||||||
$this->parser->parseFile(__DIR__.'/Fixtures/nonexistent.yml');
|
$this->parser->parseFile(__DIR__.'/Fixtures/nonexistent.yml');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testParsingNotReadableFilesThrowsException()
|
public function testParsingNotReadableFilesThrowsException()
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\Yaml\Exception\ParseException');
|
$this->expectException('Symfony\Component\Yaml\Exception\ParseException');
|
||||||
$this->expectExceptionMessageRegExp('#^File ".+/Fixtures/not_readable.yml" cannot be read\.$#');
|
$this->expectExceptionMessageMatches('#^File ".+/Fixtures/not_readable.yml" cannot be read\.$#');
|
||||||
if ('\\' === \DIRECTORY_SEPARATOR) {
|
if ('\\' === \DIRECTORY_SEPARATOR) {
|
||||||
$this->markTestSkipped('chmod is not supported on Windows');
|
$this->markTestSkipped('chmod is not supported on Windows');
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue