You are here

function SkinrWebTestBase::assertSkinrClass in Skinr 8.2

Asserts that a class is set for the given element id.

Parameters

$id: Id of the HTML element to check.

$class: The class name to check for.

$message: Message to display.

Return value

bool TRUE on pass, FALSE on fail.

1 call to SkinrWebTestBase::assertSkinrClass()
SkinrApiTest::testSkinrImplementsCache in src/Tests/SkinrApiTest.php
Tests skinr_implements() caching and auto-loading.

File

src/Tests/SkinrWebTestBase.php, line 25
Contains \Drupal\skinr\Tests\SkinrWebTestBase.

Class

SkinrWebTestBase

Namespace

Drupal\skinr\Tests

Code

function assertSkinrClass($id, $class, $message = '') {
  $elements = $this
    ->xpath('//div[@id=:id and contains(@class, :class)]', array(
    ':id' => $id,
    ':class' => $class,
  ));
  $this
    ->assertTrue(!empty($elements[0]), $message);
}