assertEqual($this->discovery->getDefinitions(), $this->expectedDefinitions); // Ensure that getDefinition() returns the expected definition. foreach ($this->expectedDefinitions as $id => $definition) { $this->assertIdentical($this->discovery->getDefinition($id), $definition); } // Ensure that an empty array is returned if no plugin definitions are found. $this->assertIdentical($this->emptyDiscovery->getDefinitions(), array(), 'array() returned if no plugin definitions are found.'); // Ensure that NULL is returned as the definition of a non-existing plugin. $this->assertIdentical($this->emptyDiscovery->getDefinition('non_existing'), NULL, 'NULL returned as the definition of a non-existing plugin.'); } }