$this->
expectException(InvalidArgumentException::
class);
$this->
expectExceptionMessage('The Translator does not support the following options: \'foo\''
);
$container =
$this->
createMock(ContainerInterface::
class);
new Translator($container,
new MessageFormatter(), 'en',
[],
['foo' => 'bar'
]);
} /** @dataProvider getDebugModeAndCacheDirCombinations */
public function testResourceFilesOptionLoadsBeforeOtherAddedResources($debug,
$enableCache) { $someCatalogue =
$this->
getCatalogue('some_locale',
[]);
$loader =
$this->
createMock(LoaderInterface::
class);
$series =
[ /* The "messages.some_locale.loader" is passed via the resource_file option and shall be loaded first */
[['messages.some_locale.loader', 'some_locale', 'messages'
],
$someCatalogue],
/* This resource is added by an addResource() call and shall be loaded after the resource_files */
[['second_resource.some_locale.loader', 'some_locale', 'messages'
],
$someCatalogue],
];
$loader->
expects($this->
exactly(2
))