You are here

public function ViewsTableHighlighterContentTaxonomyTestCase::testNumberField in Views Table Highlighter 6

File

tests/views_table_highlighter_content_taxonomy.test, line 124
Test Views Table Highlighter's interaction with Content Taxonomy.

Class

ViewsTableHighlighterContentTaxonomyTestCase
@file Test Views Table Highlighter's interaction with Content Taxonomy.

Code

public function testNumberField() {
  $this
    ->drupalSetContent(views_embed_view('views_table_highlighter_test'));
  $rows = $this
    ->xpath("//table/tbody/tr");

  // since we have 2 nodes, our table should have 2 rows.
  $this
    ->assertEqual(2, count($rows), "view result doesn't have 2 rows");

  // row 0 should be unlit
  $attr = $rows[0]
    ->attributes();
  $this
    ->assertEqual($attr['class'], 'odd views-row-first', "row 0 doesn't have the correct classes");

  // row 1 should be red
  $attr = $rows[1]
    ->attributes();
  $this
    ->assertEqual($attr['class'], 'even views-row-last views-table-highlighter-red', "row 1 doesn't have the correct classes");
}