5 * Definition of ViewsPluginStyleUnformattedTestCase.
9 * Tests the default/unformatted row style.
11 class ViewsPluginStyleUnformattedTestCase extends ViewsPluginStyleTestBase {
13 public static function getInfo() {
15 'name' => 'Style: unformatted',
16 'description' => 'Test unformatted style functionality.',
17 'group' => 'Views Plugins',
22 * Take sure that the default css classes works as expected.
24 function testDefaultRowClasses() {
25 $view = $this->getBasicView();
26 $rendered_output = $view->preview();
27 $this->storeViewPreview($rendered_output);
29 $rows = $this->elements->body->div->div->div;
31 $count_result = count($view->result);
32 foreach ($rows as $row) {
34 $attributes = $row->attributes();
35 $class = (string) $attributes['class'][0];
36 // Take sure that each row has a row css class.
37 $this->assertTrue(strpos($class, "views-row-$count") !== FALSE, 'Take sure that each row has a row css class.');
38 // Take sure that the odd/even classes are set right.
39 $odd_even = $count % 2 == 0 ? 'even' : 'odd';
40 $this->assertTrue(strpos($class, "views-row-$odd_even") !== FALSE, 'Take sure that the odd/even classes are set right.');
43 $this->assertTrue(strpos($class, "views-row-first") !== FALSE, 'Take sure that the first class is set right.');
45 else if ($count == $count_result) {
46 $this->assertTrue(strpos($class, "views-row-last") !== FALSE, 'Take sure that the last class is set right.');
49 $this->assertTrue(strpos($class, 'views-row') !== FALSE, 'Take sure that the views row class is set right.');