X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/05d99a312d29fdae6073c1205ffc2005db23f55b..refs/pull/3593/head:/tests/RecycleBinTest.php diff --git a/tests/RecycleBinTest.php b/tests/RecycleBinTest.php index f3e30c0d0..0e0524338 100644 --- a/tests/RecycleBinTest.php +++ b/tests/RecycleBinTest.php @@ -63,11 +63,12 @@ class RecycleBinTest extends TestCase $this->actingAs($editor)->delete($book->getUrl()); $viewReq = $this->asAdmin()->get('/settings/recycle-bin'); - $viewReq->assertElementContains('table.table', $page->name); - $viewReq->assertElementContains('table.table', $editor->name); - $viewReq->assertElementContains('table.table', $book->name); - $viewReq->assertElementContains('table.table', $book->pages_count . ' Pages'); - $viewReq->assertElementContains('table.table', $book->chapters_count . ' Chapters'); + $html = $this->withHtml($viewReq); + $html->assertElementContains('table.table', $page->name); + $html->assertElementContains('table.table', $editor->name); + $html->assertElementContains('table.table', $book->name); + $html->assertElementContains('table.table', $book->pages_count . ' Pages'); + $html->assertElementContains('table.table', $book->chapters_count . ' Chapters'); } public function test_recycle_bin_empty() @@ -90,7 +91,7 @@ class RecycleBinTest extends TestCase $itemCount = 2 + $book->pages->count() + $book->chapters->count(); $redirectReq = $this->get('/settings/recycle-bin'); - $redirectReq->assertNotificationContains('Deleted ' . $itemCount . ' total items from the recycle bin'); + $this->assertNotificationContains($redirectReq, 'Deleted ' . $itemCount . ' total items from the recycle bin'); } public function test_entity_restore() @@ -111,7 +112,7 @@ class RecycleBinTest extends TestCase $itemCount = 1 + $book->pages->count() + $book->chapters->count(); $redirectReq = $this->get('/settings/recycle-bin'); - $redirectReq->assertNotificationContains('Restored ' . $itemCount . ' total items from the recycle bin'); + $this->assertNotificationContains($redirectReq, 'Restored ' . $itemCount . ' total items from the recycle bin'); } public function test_permanent_delete() @@ -130,7 +131,7 @@ class RecycleBinTest extends TestCase $itemCount = 1 + $book->pages->count() + $book->chapters->count(); $redirectReq = $this->get('/settings/recycle-bin'); - $redirectReq->assertNotificationContains('Deleted ' . $itemCount . ' total items from the recycle bin'); + $this->assertNotificationContains($redirectReq, 'Deleted ' . $itemCount . ' total items from the recycle bin'); } public function test_permanent_delete_for_each_type() @@ -264,6 +265,6 @@ class RecycleBinTest extends TestCase $pageRestoreView = $this->asAdmin()->get("/settings/recycle-bin/{$pageDeletion->id}/restore"); $pageRestoreView->assertSee('The parent of this item has also been deleted.'); - $pageRestoreView->assertElementContains('a[href$="/settings/recycle-bin/' . $bookDeletion->id . '/restore"]', 'Restore Parent'); + $this->withHtml($pageRestoreView)->assertElementContains('a[href$="/settings/recycle-bin/' . $bookDeletion->id . '/restore"]', 'Restore Parent'); } }