TipPluginBaseTest.php

Same filename in other branches
  1. 9 core/modules/tour/tests/src/Unit/TipPluginBaseTest.php
  2. 11.x core/modules/tour/tests/src/Unit/TipPluginBaseTest.php

Namespace

Drupal\Tests\tour\Unit

File

core/modules/tour/tests/src/Unit/TipPluginBaseTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\tour\Unit;

use Drupal\Tests\UnitTestCase;
use Drupal\tour\TipPluginBase;

/**
 * @coversDefaultClass \Drupal\tour\TipPluginBase
 *
 * @group tour
 * @group legacy
 */
class TipPluginBaseTest extends UnitTestCase {
    
    /**
     * @covers ::getLocation
     */
    public function testGetLocationAssertion() : void {
        $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();
    }

}

Classes

Title Deprecated Summary
TipPluginBaseTest @coversDefaultClass \Drupal\tour\TipPluginBase

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.