Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
f77baa3e
Commit
f77baa3e
authored
Jan 19, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc fix
parent
87be9dea
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
test-fixture.md
docs/guide/test-fixture.md
+3
-7
No files found.
docs/guide/test-fixture.md
View file @
f77baa3e
...
@@ -117,12 +117,6 @@ class UserProfileFixture extends ActiveFixture
...
@@ -117,12 +117,6 @@ class UserProfileFixture extends ActiveFixture
}
}
```
```
Note that in the above, besides
`app\tests\fixtures\UserFixture`
, the dependency of
`UserProfileFixture`
also includes
`yii\test\DbFixture`
. This is required by all
`ActiveFixture`
classes which set
`yii\test\DbFixture`
as the default value
of the
`depends`
property. The
`DbFixture`
class is responsible for toggling database integrity check and executing
an initialization script. Without
`DbFixture`
, you may not be able to freely inserting or deleting rows in a table
due to various DB constraints.
Using Fixtures
Using Fixtures
--------------
--------------
...
@@ -194,7 +188,9 @@ This fixture will try to execute a script located at `@app/tests/fixtures/initdb
...
@@ -194,7 +188,9 @@ This fixture will try to execute a script located at `@app/tests/fixtures/initdb
for example, load a basic DB dump containing the minimal set of tables, etc.
for example, load a basic DB dump containing the minimal set of tables, etc.
Using global fixtures is similar to using non-global ones. The only difference is that you declare these fixtures
Using global fixtures is similar to using non-global ones. The only difference is that you declare these fixtures
in
[
[yii\codeception\TestCase::globalFixtures()
]
] instead of
`fixtures()`
. When a test case load fixtures, it will
in
[
[yii\codeception\TestCase::globalFixtures()
]
] instead of
`fixtures()`
. When a test case load
s
fixtures, it will
first load global fixtures and then non-global ones.
first load global fixtures and then non-global ones.
By default,
[
[yii\codeception\DbTestCase
]
] already declares
`InitDbFixture`
in its
`globalFixtures()`
method.
By default,
[
[yii\codeception\DbTestCase
]
] already declares
`InitDbFixture`
in its
`globalFixtures()`
method.
This means you only need to work with
`@app/tests/fixtures/initdb.php`
to set up your skeleton test database,
and you can then focus on developing each individual test case and the corresponding fixtures.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment