You are here

function FusionApplyUITestCase::assertFusionApplyClass in Fusion Accelerator 7

Same name and namespace in other branches
  1. 7.2 fusion_apply/tests/fusion_apply_ui.test \FusionApplyUITestCase::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.

2 calls to FusionApplyUITestCase::assertFusionApplyClass()
FusionApplyUIBasicTestCase::testSkinAdditionalEdit in fusion_apply/tests/fusion_apply_ui.test
Tests access control for editing additional CSS classes.
FusionApplyUIBasicTestCase::testSkinEdit in fusion_apply/tests/fusion_apply_ui.test
Tests basic configuration and applying of a skin.

File

fusion_apply/tests/fusion_apply_ui.test, line 72
Tests for the Fusion Apply UI module.

Class

FusionApplyUITestCase
Base class for Fusion Apply UI tests.

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