class YamlDiscoveryTest in Drupal 10
Same name in this branch
- 10 core/tests/Drupal/Tests/Core/Discovery/YamlDiscoveryTest.php \Drupal\Tests\Core\Discovery\YamlDiscoveryTest
- 10 core/tests/Drupal/Tests/Component/Discovery/YamlDiscoveryTest.php \Drupal\Tests\Component\Discovery\YamlDiscoveryTest
- 10 core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryTest.php \Drupal\Tests\Core\Plugin\Discovery\YamlDiscoveryTest
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Discovery/YamlDiscoveryTest.php \Drupal\Tests\Core\Discovery\YamlDiscoveryTest
- 9 core/tests/Drupal/Tests/Core/Discovery/YamlDiscoveryTest.php \Drupal\Tests\Core\Discovery\YamlDiscoveryTest
YamlDiscovery component unit tests.
@group Discovery
Hierarchy
- class \Drupal\Tests\Core\Discovery\YamlDiscoveryTest extends \PHPUnit\Framework\TestCase
Expanded class hierarchy of YamlDiscoveryTest
File
- core/
tests/ Drupal/ Tests/ Core/ Discovery/ YamlDiscoveryTest.php, line 18
Namespace
Drupal\Tests\Core\DiscoveryView source
class YamlDiscoveryTest extends TestCase {
/**
* {@inheritdoc}
*/
protected function setUp() : void {
// Ensure that FileCacheFactory has a prefix.
FileCacheFactory::setPrefix('prefix');
}
/**
* Tests if filename is output for a broken YAML file.
*/
public function testFilenameForBrokenYml() {
vfsStreamWrapper::register();
$root = new vfsStreamDirectory('modules');
vfsStreamWrapper::setRoot($root);
$url = vfsStream::url('modules');
mkdir($url . '/test_broken');
file_put_contents($url . '/test_broken/test_broken.test.yml', "broken:\n:");
$this
->expectException(InvalidDataTypeException::class);
$this
->expectExceptionMessage('vfs://modules/test_broken/test_broken.test.yml');
$directories = [
'test_broken' => $url . '/test_broken',
];
$discovery = new YamlDiscovery('test', $directories);
$discovery
->findAll();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
YamlDiscoveryTest:: |
protected | function | ||
YamlDiscoveryTest:: |
public | function | Tests if filename is output for a broken YAML file. |