mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-01 13:53:09 +08:00
Extracted entity testcase methods to own class
Also added some new fetch helper methods for future use.
This commit is contained in:
@ -246,13 +246,13 @@ class BookTest extends TestCase
|
||||
|
||||
public function test_slug_multi_byte_url_safe()
|
||||
{
|
||||
$book = $this->newBook([
|
||||
$book = $this->entities->newBook([
|
||||
'name' => 'информация',
|
||||
]);
|
||||
|
||||
$this->assertEquals('informaciya', $book->slug);
|
||||
|
||||
$book = $this->newBook([
|
||||
$book = $this->entities->newBook([
|
||||
'name' => '¿Qué?',
|
||||
]);
|
||||
|
||||
@ -261,7 +261,7 @@ class BookTest extends TestCase
|
||||
|
||||
public function test_slug_format()
|
||||
{
|
||||
$book = $this->newBook([
|
||||
$book = $this->entities->newBook([
|
||||
'name' => 'PartA / PartB / PartC',
|
||||
]);
|
||||
|
||||
@ -311,7 +311,7 @@ class BookTest extends TestCase
|
||||
foreach ($book->getDirectChildren() as $child) {
|
||||
$child->restricted = true;
|
||||
$child->save();
|
||||
$this->regenEntityPermissions($child);
|
||||
$this->entities->regenPermissions($child);
|
||||
}
|
||||
|
||||
$this->asEditor()->post($book->getUrl('/copy'), ['name' => 'My copy book']);
|
||||
@ -365,7 +365,7 @@ class BookTest extends TestCase
|
||||
|
||||
$viewer = $this->getViewer();
|
||||
$this->giveUserPermissions($viewer, ['book-update-all', 'book-create-all', 'bookshelf-update-all']);
|
||||
$this->setEntityRestrictions($shelfB);
|
||||
$this->entities->setPermissions($shelfB);
|
||||
|
||||
|
||||
$this->asEditor()->post($book->getUrl('/copy'), ['name' => 'My copy book']);
|
||||
|
Reference in New Issue
Block a user