mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-01 05:51:52 +08:00
Fixed name retrieval on missing users and added tests to cover along with some test helper methods
This commit is contained in:
@ -171,4 +171,29 @@ class EntityTest extends TestCase
|
||||
}
|
||||
|
||||
|
||||
public function testEntitiesViewableAfterCreatorDeletion()
|
||||
{
|
||||
$creator = $this->getNewUser();
|
||||
$updater = $this->getNewUser();
|
||||
$entities = $this->createEntityChainBelongingToUser($creator, $updater);
|
||||
app('BookStack\Repos\UserRepo')->destroy($creator);
|
||||
|
||||
$this->asAdmin()->visit($entities['book']->getUrl())->seeStatusCode(200)
|
||||
->visit($entities['chapter']->getUrl())->seeStatusCode(200)
|
||||
->visit($entities['page']->getUrl())->seeStatusCode(200);
|
||||
}
|
||||
|
||||
public function testEntitiesViewableAfterUpdaterDeletion()
|
||||
{
|
||||
$creator = $this->getNewUser();
|
||||
$updater = $this->getNewUser();
|
||||
$entities = $this->createEntityChainBelongingToUser($creator, $updater);
|
||||
app('BookStack\Repos\UserRepo')->destroy($updater);
|
||||
|
||||
$this->asAdmin()->visit($entities['book']->getUrl())->seeStatusCode(200)
|
||||
->visit($entities['chapter']->getUrl())->seeStatusCode(200)
|
||||
->visit($entities['page']->getUrl())->seeStatusCode(200);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user