Mercurial > hg > isophonics-drupal-site
comparison core/modules/tour/src/Tests/TourTestBase.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
53 // Check for corresponding page elements. | 53 // Check for corresponding page elements. |
54 $total = 0; | 54 $total = 0; |
55 $modals = 0; | 55 $modals = 0; |
56 foreach ($tips as $tip) { | 56 foreach ($tips as $tip) { |
57 if (!empty($tip['data-id'])) { | 57 if (!empty($tip['data-id'])) { |
58 $elements = \PHPUnit_Util_XML::cssSelect('#' . $tip['data-id'], TRUE, $this->content, TRUE); | 58 $elements = $this->xpath('//*[@id="' . $tip['data-id'] . '"]'); |
59 $this->assertTrue(!empty($elements) && count($elements) === 1, format_string('Found corresponding page element for tour tip with id #%data-id', ['%data-id' => $tip['data-id']])); | 59 $this->assertTrue(!empty($elements) && count($elements) === 1, format_string('Found corresponding page element for tour tip with id #%data-id', ['%data-id' => $tip['data-id']])); |
60 } | 60 } |
61 elseif (!empty($tip['data-class'])) { | 61 elseif (!empty($tip['data-class'])) { |
62 $elements = \PHPUnit_Util_XML::cssSelect('.' . $tip['data-class'], TRUE, $this->content, TRUE); | 62 $elements = $this->xpath('//*[contain(@class, "' . $tip['data-id'] . '")]'); |
63 $this->assertFalse(empty($elements), format_string('Found corresponding page element for tour tip with class .%data-class', ['%data-class' => $tip['data-class']])); | 63 $this->assertFalse(empty($elements), format_string('Found corresponding page element for tour tip with class .%data-class', ['%data-class' => $tip['data-class']])); |
64 } | 64 } |
65 else { | 65 else { |
66 // It's a modal. | 66 // It's a modal. |
67 $modals++; | 67 $modals++; |