You are here

function SkinrWebTestCase::assertSkinrClass in Skinr 7.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

TRUE on pass, FALSE on fail.

3 calls to SkinrWebTestCase::assertSkinrClass()
SkinrApiTestCase::testSkinrImplementsCache in tests/skinr.test
Tests skinr_implements() caching and auto-loading.
SkinrContextDisplayTestCase::testSkinrContextDisplayed in skinr_context/tests/skinr_context.test
SkinrDisplayTestCase::testSkinrDisplayed in tests/skinr.test

File

tests/skinr.test, line 21
Tests for the Skinr module.

Class

SkinrWebTestCase
@file Tests for the Skinr module.

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);
}