]> BookStack Code Mirror - bookstack/blobdiff - tests/RecycleBinTest.php
Added language list favourites sorting, updated styles
[bookstack] / tests / RecycleBinTest.php
index f3e30c0d07d442f894347f7599e97e3e1c9218fc..0e05243380f52cd2838d15b8889aa5a420f06b32 100644 (file)
@@ -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');
     }
 }