Skip to content

Commit e111cef

Browse files
committed
Update pagination test to work with Laravel 5.5
1 parent 83fb9ca commit e111cef

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tests/Feature/PaginationTest.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,22 @@ class PaginationTest extends FeatureTestCase
77
{
88
public function testPaginationProvidesDifferentLinksOnDifferentPages()
99
{
10+
$page1ActiveLink = starts_with(app()->version(), "5.5")
11+
? '<li class="active"><span>1</span></li>'
12+
: '<li class="page-item active"><span class="page-link">1</span></li>';
13+
$page2ActiveLink = starts_with(app()->version(), "5.5")
14+
? '<li class="active"><span>2</span></li>'
15+
: '<li class="page-item active"><span class="page-link">2</span></li>';
16+
1017
$book = (new Book)
1118
->take(11)
1219
->get()
1320
->last();
1421
$page1 = $this->visit("pagination-test");
1522

16-
$this->assertTrue(str_contains($page1->response->getContent(), '<li class="page-item active"><span class="page-link">1</span></li>'));
17-
23+
$page1->see($page1ActiveLink);
1824
$page2 = $page1->click("2");
19-
20-
$this->assertTrue(str_contains($page2->response->getContent(), '<li class="page-item active"><span class="page-link">2</span></li>'));
25+
$page2->see($page2ActiveLink);
2126
$page2->see($book->title);
2227
}
2328
}

0 commit comments

Comments
 (0)