Mercurial > hg > isophonics-drupal-site
comparison core/modules/tour/tests/src/Functional/TourTestBase.php @ 12:7a779792577d
Update Drupal core to v8.4.5 (via Composer)
author | Chris Cannam |
---|---|
date | Fri, 23 Feb 2018 15:52:07 +0000 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
11:bfffd8d7479a | 12:7a779792577d |
---|---|
48 } | 48 } |
49 else { | 49 else { |
50 // Check for corresponding page elements. | 50 // Check for corresponding page elements. |
51 $total = 0; | 51 $total = 0; |
52 $modals = 0; | 52 $modals = 0; |
53 $raw_content = $this->getSession()->getPage()->getContent(); | |
54 foreach ($tips as $tip) { | 53 foreach ($tips as $tip) { |
55 if (!empty($tip['data-id'])) { | 54 if (!empty($tip['data-id'])) { |
56 $elements = \PHPUnit_Util_XML::cssSelect('#' . $tip['data-id'], TRUE, $raw_content, TRUE); | 55 $elements = $this->getSession()->getPage()->findAll('css', '#' . $tip['data-id']); |
57 $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']])); | 56 $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']])); |
58 } | 57 } |
59 elseif (!empty($tip['data-class'])) { | 58 elseif (!empty($tip['data-class'])) { |
60 $elements = \PHPUnit_Util_XML::cssSelect('.' . $tip['data-class'], TRUE, $raw_content, TRUE); | 59 $elements = $this->getSession()->getPage()->findAll('css', '.' . $tip['data-class']); |
61 $this->assertFalse(empty($elements), format_string('Found corresponding page element for tour tip with class .%data-class', ['%data-class' => $tip['data-class']])); | 60 $this->assertFalse(empty($elements), format_string('Found corresponding page element for tour tip with class .%data-class', ['%data-class' => $tip['data-class']])); |
62 } | 61 } |
63 else { | 62 else { |
64 // It's a modal. | 63 // It's a modal. |
65 $modals++; | 64 $modals++; |