From 5491bd62a2879f10c5bfe3ff06dced34780b7980 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Sat, 21 Dec 2019 13:48:44 +0000 Subject: [PATCH] Fixed test failing due to redirect changes - Also set APP_THEME param during testing to avoid local conflicts --- phpunit.xml | 1 + tests/Permissions/RolesTest.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index 48eba5e99..546829247 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -22,6 +22,7 @@ + diff --git a/tests/Permissions/RolesTest.php b/tests/Permissions/RolesTest.php index 371cffc0f..2ef72fb0a 100644 --- a/tests/Permissions/RolesTest.php +++ b/tests/Permissions/RolesTest.php @@ -637,14 +637,14 @@ class RolesTest extends BrowserKitTest $ownPage->getUrl() => 'Delete' ]); - $bookUrl = $ownPage->book->getUrl(); + $parent = $ownPage->chapter ?? $ownPage->book; $this->visit($otherPage->getUrl()) ->dontSeeInElement('.action-buttons', 'Delete') ->visit($otherPage->getUrl() . '/delete') ->seePageIs('/'); $this->visit($ownPage->getUrl())->visit($ownPage->getUrl() . '/delete') ->press('Confirm') - ->seePageIs($bookUrl) + ->seePageIs($parent->getUrl()) ->dontSeeInElement('.book-content', $ownPage->name); } @@ -658,10 +658,10 @@ class RolesTest extends BrowserKitTest $otherPage->getUrl() => 'Delete' ]); - $bookUrl = $otherPage->book->getUrl(); + $parent = $otherPage->chapter ?? $otherPage->book; $this->visit($otherPage->getUrl())->visit($otherPage->getUrl() . '/delete') ->press('Confirm') - ->seePageIs($bookUrl) + ->seePageIs($parent->getUrl()) ->dontSeeInElement('.book-content', $otherPage->name); }