Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Зуев Егор
/
wiki.dev
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Authored by
Dan Brown
2017-02-05 14:37:50 +0000
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
d369d315a7e43320ed85e2e4feadd66601a3b06d
d369d315
1 parent
7c9937e9
Fixed non-browserkit testcase and seeder issues
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
3 deletions
composer.lock
database/seeds/DummyContentSeeder.php
tests/TestCase.php
composer.lock
View file @
d369d31
This diff is collapsed.
Click to expand it.
database/seeds/DummyContentSeeder.php
View file @
d369d31
...
...
@@ -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
);
...
...
tests/TestCase.php
View file @
d369d31
...
...
@@ -4,11 +4,13 @@ use BookStack\Book;
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
;
...
...
Please
register
or
sign in
to post a comment