From 0a2c41c0f2f4651959d88316b6003c2c858393fb Mon Sep 17 00:00:00 2001
From: Mike Bronner <mike@genealabs.com>
Date: Mon, 5 Mar 2018 06:58:14 -0800
Subject: [PATCH 1/2] Fix package dependencies for L5.5

---
 composer.json | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/composer.json b/composer.json
index f382d5a..581e9db 100644
--- a/composer.json
+++ b/composer.json
@@ -9,27 +9,27 @@
         }
     ],
     "require": {
+        "fico7489/laravel-pivot": "*",
         "illuminate/cache": "5.5 - 5.6",
         "illuminate/config": "5.5 - 5.6",
         "illuminate/console": "5.5 - 5.6",
         "illuminate/database": "5.5 - 5.6",
         "illuminate/support": "5.5 - 5.6",
-        "php": ">=7.1.3",
-        "fico7489/laravel-pivot": "^2.2"
+        "php": ">=7.1.3"
     },
     "require-dev": {
         "codedungeon/phpunit-result-printer": "*",
         "fzaninotto/faker": "~1.4",
         "mockery/mockery": "0.9.*",
-        "orchestra/database": "3.6.x-dev@dev",
-        "orchestra/testbench": "^3.6",
-        "orchestra/testbench-browser-kit": "^3.6",
+        "orchestra/database": "3.5.*",
+        "orchestra/testbench-browser-kit": "3.5.*",
+        "orchestra/testbench": "3.5.*",
         "php-coveralls/php-coveralls" : "*",
         "phpmd/phpmd": "*",
         "phpunit/phpunit": "*",
+        "predis/predis": "^1.1",
         "sebastian/phpcpd": "*",
-        "symfony/thanks": "^1.0",
-        "predis/predis": "^1.1"
+        "symfony/thanks": "^1.0"
     },
     "autoload": {
         "psr-4": {

From 83d41783e0d3f43395bce3411d4f4f597e264eea Mon Sep 17 00:00:00 2001
From: Mike Bronner <mike@genealabs.com>
Date: Mon, 5 Mar 2018 06:58:26 -0800
Subject: [PATCH 2/2] Update pagination tests to match 5.5 output

---
 tests/Feature/PaginationTest.php              | 13 +++++++---
 .../CachedBuilderPaginationTest.php           | 25 ++++++++++---------
 2 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/tests/Feature/PaginationTest.php b/tests/Feature/PaginationTest.php
index fcf38b3..5be2505 100644
--- a/tests/Feature/PaginationTest.php
+++ b/tests/Feature/PaginationTest.php
@@ -7,17 +7,22 @@ class PaginationTest extends FeatureTestCase
 {
     public function testPaginationProvidesDifferentLinksOnDifferentPages()
     {
+        $page1ActiveLink = starts_with(app()->version(), "5.5")
+            ? '<li class="active"><span>1</span></li>'
+            : '<li class="page-item active"><span class="page-link">1</span></li>';
+        $page2ActiveLink = starts_with(app()->version(), "5.5")
+            ? '<li class="active"><span>2</span></li>'
+            : '<li class="page-item active"><span class="page-link">2</span></li>';
+
         $book = (new Book)
             ->take(11)
             ->get()
             ->last();
         $page1 = $this->visit("pagination-test");
 
-        $this->assertTrue(str_contains($page1->response->getContent(), '<li class="page-item active"><span class="page-link">1</span></li>'));
-
+        $page1->see($page1ActiveLink);
         $page2 = $page1->click("2");
-
-        $this->assertTrue(str_contains($page2->response->getContent(), '<li class="page-item active"><span class="page-link">2</span></li>'));
+        $page2->see($page2ActiveLink);
         $page2->see($book->title);
     }
 }
diff --git a/tests/Integration/CachedBuilderPaginationTest.php b/tests/Integration/CachedBuilderPaginationTest.php
index dc00a36..3182b02 100644
--- a/tests/Integration/CachedBuilderPaginationTest.php
+++ b/tests/Integration/CachedBuilderPaginationTest.php
@@ -44,6 +44,16 @@ public function testPaginationIsCached()
 
     public function testPaginationReturnsCorrectLinks()
     {
+        $page1ActiveLink = starts_with(app()->version(), "5.5")
+            ? '<li class="active"><span>1</span></li>'
+            : '<li class="page-item active"><span class="page-link">1</span></li>';
+        $page2ActiveLink = starts_with(app()->version(), "5.5")
+            ? '<li class="active"><span>2</span></li>'
+            : '<li class="page-item active"><span class="page-link">2</span></li>';
+        $page24ActiveLink = starts_with(app()->version(), "5.5")
+            ? '<li class="active"><span>24</span></li>'
+            : '<li class="page-item active"><span class="page-link">24</span></li>';
+
         $booksPage1 = (new Book)
             ->paginate(2);
         $booksPage2 = (new Book)
@@ -54,17 +64,8 @@ public function testPaginationReturnsCorrectLinks()
         $this->assertCount(2, $booksPage1);
         $this->assertCount(2, $booksPage2);
         $this->assertCount(2, $booksPage24);
-        $this->assertContains(
-            '<li class="page-item active"><span class="page-link">1</span></li>',
-            (string) $booksPage1->links()
-        );
-        $this->assertContains(
-            '<li class="page-item active"><span class="page-link">2</span></li>',
-            (string) $booksPage2->links()
-        );
-        $this->assertContains(
-            '<li class="page-item active"><span class="page-link">24</span></li>',
-            (string) $booksPage24->links()
-        );
+        $this->assertContains($page1ActiveLink, (string) $booksPage1->links());
+        $this->assertContains($page2ActiveLink, (string) $booksPage2->links());
+        $this->assertContains($page24ActiveLink, (string) $booksPage24->links());
     }
 }
