You are here

function FusionApplyDisplayTestCase::assertFusionApplyClass in Fusion Accelerator 7

Same name and namespace in other branches
  1. 7.2 fusion_apply/tests/fusion_apply.test \FusionApplyDisplayTestCase::assertFusionApplyClass()

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.

1 call to FusionApplyDisplayTestCase::assertFusionApplyClass()
FusionApplyDisplayTestCase::testFusionApplyDisplayed in fusion_apply/tests/fusion_apply.test

File

fusion_apply/tests/fusion_apply.test, line 500
Tests for the Fusion Apply module.

Class

FusionApplyDisplayTestCase
Tests API functionality.

Code

function assertFusionApplyClass($id, $class, $message = '') {
  $elements = $this
    ->xpath('//div[@id=:id]', array(
    ':id' => $id,
  ));
  $class_attr = (string) $elements[0]['class'];
  $this
    ->assertTrue(strpos($class_attr, ' ' . $class . ' '), $message);
}