Dan Brown

Fixed non-browserkit testcase and seeder issues

...@@ -11,14 +11,14 @@ class DummyContentSeeder extends Seeder ...@@ -11,14 +11,14 @@ class DummyContentSeeder extends Seeder
11 */ 11 */
12 public function run() 12 public function run()
13 { 13 {
14 - $user = factory(BookStack\User::class, 1)->create(); 14 + $user = factory(\BookStack\User::class)->create();
15 $role = \BookStack\Role::getRole('editor'); 15 $role = \BookStack\Role::getRole('editor');
16 $user->attachRole($role); 16 $user->attachRole($role);
17 17
18 18
19 - $books = factory(BookStack\Book::class, 20)->create(['created_by' => $user->id, 'updated_by' => $user->id]) 19 + $books = factory(\BookStack\Book::class, 20)->create(['created_by' => $user->id, 'updated_by' => $user->id])
20 ->each(function($book) use ($user) { 20 ->each(function($book) use ($user) {
21 - $chapters = factory(BookStack\Chapter::class, 5)->create(['created_by' => $user->id, 'updated_by' => $user->id]) 21 + $chapters = factory(\BookStack\Chapter::class, 5)->create(['created_by' => $user->id, 'updated_by' => $user->id])
22 ->each(function($chapter) use ($user, $book){ 22 ->each(function($chapter) use ($user, $book){
23 $pages = factory(\BookStack\Page::class, 5)->make(['created_by' => $user->id, 'updated_by' => $user->id, 'book_id' => $book->id]); 23 $pages = factory(\BookStack\Page::class, 5)->make(['created_by' => $user->id, 'updated_by' => $user->id, 'book_id' => $book->id]);
24 $chapter->pages()->saveMany($pages); 24 $chapter->pages()->saveMany($pages);
......
...@@ -4,11 +4,13 @@ use BookStack\Book; ...@@ -4,11 +4,13 @@ use BookStack\Book;
4 use BookStack\Chapter; 4 use BookStack\Chapter;
5 use BookStack\Repos\EntityRepo; 5 use BookStack\Repos\EntityRepo;
6 use BookStack\Role; 6 use BookStack\Role;
7 +use Illuminate\Foundation\Testing\DatabaseTransactions;
7 use Illuminate\Foundation\Testing\TestCase as BaseTestCase; 8 use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
8 9
9 abstract class TestCase extends BaseTestCase 10 abstract class TestCase extends BaseTestCase
10 { 11 {
11 use CreatesApplication; 12 use CreatesApplication;
13 + use DatabaseTransactions;
12 14
13 protected $admin; 15 protected $admin;
14 16
......