You are here

class NgLightboxWebTest in NG Lightbox 2.x

Same name and namespace in other branches
  1. 8 src/Tests/NgLightboxWebTest.php \Drupal\ng_lightbox\Tests\NgLightboxWebTest

A web test for NG Lightbox.

@group ng_lightbox

Hierarchy

  • class \Drupal\ng_lightbox\Tests\NgLightboxWebTest extends \Drupal\simpletest\WebTestBase

Expanded class hierarchy of NgLightboxWebTest

File

src/Tests/NgLightboxWebTest.php, line 12

Namespace

Drupal\ng_lightbox\Tests
View source
class NgLightboxWebTest extends WebTestBase {

  /**
   * {@inheritdoc}
   */
  protected $profile = 'minimal';

  /**
   * Modules to install.
   *
   * @var array
   */
  public static $modules = [
    'ng_lightbox',
    'views',
    'node',
    'filter',
  ];

  /**
   * {@inheritdoc}
   */
  public function setUp() {
    parent::setUp();
    $config = \Drupal::configFactory()
      ->getEditable('ng_lightbox.settings');
    $this
      ->createContentType([
      'type' => 'page',
    ]);
    $node = $this
      ->drupalCreateNode();
    $config
      ->set('patterns', '/node/' . $node
      ->id());
    $config
      ->save();
  }

  /**
   * Test that we can render a modal even before selecting one from the admin.
   */
  public function testDefaultModal() {
    $this
      ->drupalGet('/node');
    $this
      ->assertRaw('data-dialog-type="modal"');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
NgLightboxWebTest::$modules public static property Modules to install.
NgLightboxWebTest::$profile protected property
NgLightboxWebTest::setUp public function
NgLightboxWebTest::testDefaultModal public function Test that we can render a modal even before selecting one from the admin.