public function FilteredStorageTest::testInvalidStorageFilterArgument in Config Filter 8
Same name and namespace in other branches
- 8.2 src/Tests/FilteredStorageTest.php \Drupal\config_filter\Tests\FilteredStorageTest::testInvalidStorageFilterArgument()
Test that an exception is thrown when invalid arguments are passed.
File
- src/
Tests/ FilteredStorageTest.php, line 373
Class
- FilteredStorageTest
- Tests StorageWrapper operations using the CachedStorage.
Namespace
Drupal\config_filter\TestsCode
public function testInvalidStorageFilterArgument() {
$source = $this
->prophesize(StorageInterface::class);
// We would do this with $this->expectException but alas drupal is stuck on
// phpunit 4 and we try not to add deprecated code.
try {
new FilteredStorage($source
->reveal(), [
new \stdClass(),
]);
$this
->fail('An exception should have been thrown.');
} catch (InvalidStorageFilterException $exception) {
$this
->assertTrue(TRUE);
}
}