Skip to content

Commit

Permalink
Fixed non-browserkit testcase and seeder issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ssddanbrown committed Feb 5, 2017
1 parent 7c9937e commit d369d31
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 52 deletions.
98 changes: 49 additions & 49 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions database/seeds/DummyContentSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ class DummyContentSeeder extends Seeder
*/
public function run()
{
$user = factory(BookStack\User::class, 1)->create();
$user = factory(\BookStack\User::class)->create();
$role = \BookStack\Role::getRole('editor');
$user->attachRole($role);


$books = factory(BookStack\Book::class, 20)->create(['created_by' => $user->id, 'updated_by' => $user->id])
$books = factory(\BookStack\Book::class, 20)->create(['created_by' => $user->id, 'updated_by' => $user->id])
->each(function($book) use ($user) {
$chapters = factory(BookStack\Chapter::class, 5)->create(['created_by' => $user->id, 'updated_by' => $user->id])
$chapters = factory(\BookStack\Chapter::class, 5)->create(['created_by' => $user->id, 'updated_by' => $user->id])
->each(function($chapter) use ($user, $book){
$pages = factory(\BookStack\Page::class, 5)->make(['created_by' => $user->id, 'updated_by' => $user->id, 'book_id' => $book->id]);
$chapter->pages()->saveMany($pages);
Expand Down
2 changes: 2 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
use BookStack\Chapter;
use BookStack\Repos\EntityRepo;
use BookStack\Role;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;

abstract class TestCase extends BaseTestCase
{
use CreatesApplication;
use DatabaseTransactions;

protected $admin;

Expand Down

0 comments on commit d369d31

Please sign in to comment.