mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Started testing work for recycle bin implementation
This commit is contained in:
27
tests/Entity/PageTest.php
Normal file
27
tests/Entity/PageTest.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php namespace Tests\Entity;
|
||||
|
||||
use BookStack\Entities\Page;
|
||||
use Tests\TestCase;
|
||||
|
||||
class PageTest extends TestCase
|
||||
{
|
||||
public function test_page_delete()
|
||||
{
|
||||
$page = Page::query()->first();
|
||||
$this->assertNull($page->deleted_at);
|
||||
|
||||
$deleteViewReq = $this->asEditor()->get($page->getUrl('/delete'));
|
||||
$deleteViewReq->assertSeeText('Are you sure you want to delete this page?');
|
||||
|
||||
$deleteReq = $this->delete($page->getUrl());
|
||||
$deleteReq->assertRedirect($page->getParent()->getUrl());
|
||||
$this->assertActivityExists('page_delete', $page);
|
||||
|
||||
$page->refresh();
|
||||
$this->assertNotNull($page->deleted_at);
|
||||
$this->assertTrue($page->deletions()->count() === 1);
|
||||
|
||||
$redirectReq = $this->get($deleteReq->baseResponse->headers->get('location'));
|
||||
$redirectReq->assertNotificationContains('Page Successfully Deleted');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user