You are here

public function DefaultPluginManagerTest::test_createInstance in Service Container 7.2

Same name and namespace in other branches
  1. 7 tests/src/Plugin/DefaultPluginManagerTest.php \Drupal\Tests\service_container\Plugin\DefaultPluginManagerTest::test_createInstance()

@covers ::createInstance()

File

tests/src/Plugin/DefaultPluginManagerTest.php, line 131
Contains \Drupal\Tests\service_container\Plugin\DefaultPluginManagerTest

Class

DefaultPluginManagerTest
@coversDefaultClass \Drupal\service_container\Plugin\DefaultPluginManager @group dic

Namespace

Drupal\Tests\service_container\Plugin

Code

public function test_createInstance() {
  $this
    ->assertInstanceOf($this->definitions['foo']['class'], $this->pluginManager
    ->createInstance('foo'), 'Returned foo instance matches.');
  $this
    ->assertInstanceOf($this->definitions['foo']['class'], $this->fallbackPluginManager
    ->createInstance('bar'), 'Fallback to foo was successful.');
}