You are here

public function TipPluginBaseTest::testGetLocationAssertion in Drupal 9

@covers ::getLocation

File

core/modules/tour/tests/src/Unit/TipPluginBaseTest.php, line 18

Class

TipPluginBaseTest
@coversDefaultClass \Drupal\tour\TipPluginBase

Namespace

Drupal\Tests\tour\Unit

Code

public function testGetLocationAssertion() {
  $base_plugin = $this
    ->getMockForAbstractClass(TipPluginBase::class, [], '', FALSE);
  $base_plugin
    ->set('position', 'right');
  $this
    ->assertSame('right', $base_plugin
    ->getLocation());
  $base_plugin
    ->set('position', 'not_valid');
  $this
    ->expectException(\AssertionError::class);
  $this
    ->expectExceptionMessage('not_valid is not a valid Tour Tip position value');
  $base_plugin
    ->getLocation();
}