You are here

public function VariantCollectionTraitTest::testGetVariantException in Chaos Tool Suite (ctools) 8.3

@covers ::getVariant

@depends testRemoveVariant

File

tests/src/Unit/VariantCollectionTraitTest.php, line 147

Class

VariantCollectionTraitTest
Tests the methods of a variant-aware class.

Namespace

Drupal\Tests\ctools\Unit

Code

public function testGetVariantException($data) {
  list($trait_object, $uuid) = $data;

  // Attempt to retrieve a variant that has been removed.
  $this
    ->expectException('\\Drupal\\Component\\Plugin\\Exception\\PluginNotFoundException');
  $this
    ->expectExceptionMessage("Plugin ID 'test-uuid' was not found.");
  $this
    ->assertNull($trait_object
    ->getVariant($uuid));
}