diff --git a/core/modules/book/src/Tests/BookBreadcrumbTest.php b/core/modules/book/tests/src/Functional/BookBreadcrumbTest.php similarity index 95% rename from core/modules/book/src/Tests/BookBreadcrumbTest.php rename to core/modules/book/tests/src/Functional/BookBreadcrumbTest.php index 57e1b3d..69c0d62 100644 --- a/core/modules/book/src/Tests/BookBreadcrumbTest.php +++ b/core/modules/book/tests/src/Functional/BookBreadcrumbTest.php @@ -1,15 +1,15 @@ xpath('//nav[@class="breadcrumb"]/ol/li/a'); $got_breadcrumb = []; foreach ($links as $link) { - $got_breadcrumb[] = (string) $link; + $got_breadcrumb[] = $link->getText(); } // Home link and four parent book nodes should be in the breadcrumb. $this->assertEqual(5, count($got_breadcrumb)); @@ -162,7 +162,7 @@ public function testBreadcrumbTitleUpdates() { $links = $this->xpath('//nav[@class="breadcrumb"]/ol/li/a'); $got_breadcrumb = []; foreach ($links as $link) { - $got_breadcrumb[] = (string) $link; + $got_breadcrumb[] = $link->getText(); } $this->assertEqual(5, count($got_breadcrumb)); $this->assertEqual($edit['title[0][value]'], end($got_breadcrumb)); @@ -183,7 +183,7 @@ public function testBreadcrumbAccessUpdates() { $links = $this->xpath('//nav[@class="breadcrumb"]/ol/li/a'); $got_breadcrumb = []; foreach ($links as $link) { - $got_breadcrumb[] = (string) $link; + $got_breadcrumb[] = $link->getText(); } $this->assertEqual(5, count($got_breadcrumb)); $this->assertEqual($edit['title[0][value]'], end($got_breadcrumb)); @@ -193,7 +193,7 @@ public function testBreadcrumbAccessUpdates() { $links = $this->xpath('//nav[@class="breadcrumb"]/ol/li/a'); $got_breadcrumb = []; foreach ($links as $link) { - $got_breadcrumb[] = (string) $link; + $got_breadcrumb[] = $link->getText(); } $this->assertEqual(4, count($got_breadcrumb)); $this->assertEqual($nodes[2]->getTitle(), end($got_breadcrumb)); diff --git a/core/modules/book/src/Tests/BookInstallTest.php b/core/modules/book/tests/src/Functional/BookInstallTest.php similarity index 88% rename from core/modules/book/src/Tests/BookInstallTest.php rename to core/modules/book/tests/src/Functional/BookInstallTest.php index ba70a9b..9dde5e8 100644 --- a/core/modules/book/src/Tests/BookInstallTest.php +++ b/core/modules/book/tests/src/Functional/BookInstallTest.php @@ -1,8 +1,8 @@ xpath('//nav[@class="breadcrumb"]/ol/li/a'); $got_breadcrumb = []; foreach ($links as $link) { - $got_breadcrumb[] = (string) $link['href']; + $got_breadcrumb[] = $link->getAttribute('href'); } // Compare expected and got breadcrumbs. @@ -690,7 +690,7 @@ public function testAdminBookNodeListing() { $this->assertText($this->book->label(), 'The book title is displayed on the administrative book listing page.'); $elements = $this->xpath('//table//ul[@class="dropbutton"]/li/a'); - $this->assertEqual((string) $elements[0], 'View', 'View link is found from the list.'); + $this->assertEqual($elements[0]->getText(), 'View', 'View link is found from the list.'); } /**