public function YamlDiscoveryTest::testGetDefinitions in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryTest.php \Drupal\Tests\Core\Plugin\Discovery\YamlDiscoveryTest::testGetDefinitions()
Tests the getDefinitions() method.
File
- core/
tests/ Drupal/ Tests/ Core/ Plugin/ Discovery/ YamlDiscoveryTest.php, line 56 - Contains \Drupal\Tests\Core\Plugin\Discovery\YamlDiscoveryTest.
Class
- YamlDiscoveryTest
- @coversDefaultClass \Drupal\Core\Plugin\Discovery\YamlDiscovery @group Plugin
Namespace
Drupal\Tests\Core\Plugin\DiscoveryCode
public function testGetDefinitions() {
$definitions = $this->discovery
->getDefinitions();
$this
->assertInternalType('array', $definitions);
$this
->assertCount(4, $definitions);
foreach ($this->expectedKeys as $expected_key) {
$this
->assertArrayHasKey($expected_key, $definitions);
}
foreach ($definitions as $id => $definition) {
foreach (array(
'name',
'id',
'provider',
) as $key) {
$this
->assertArrayHasKey($key, $definition);
}
$this
->assertEquals($id, $definition['id']);
$this
->assertEquals(array_search($id, $this->expectedKeys), $definition['provider']);
}
}