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
f5ee8e45
Commit
f5ee8e45
authored
Aug 24, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added faker to basic app console commands, adjusted readme to mention database setup
parent
a9445b4a
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
3 deletions
+50
-3
README.md
apps/basic/tests/README.md
+23
-3
yii_acceptance
apps/basic/tests/codeception/bin/yii_acceptance
+7
-0
yii_functional
apps/basic/tests/codeception/bin/yii_functional
+7
-0
yii_unit
apps/basic/tests/codeception/bin/yii_unit
+7
-0
.gitignore
apps/basic/tests/codeception/fixtures/.gitignore
+3
-0
.gitignore
apps/basic/tests/codeception/templates/.gitignore
+3
-0
No files found.
apps/basic/tests/README.md
View file @
f5ee8e45
...
...
@@ -21,20 +21,40 @@ Changed current directory to <directory>
Then add
`<directory>/vendor/bin`
to you
`PATH`
environment variable. Now we're able to use
`codecept`
from command
line globally.
2.
Build the test suites:
2.
Install faker extension by running the following from template root directory where
`composer.json`
is:
```
composer require --dev yiisoft/yii2-faker:*
```
3.
Create three databases that are used in tests:
*
`yii2_basic_unit`
- for unit tests;
*
`yii2_basic_functional`
- for functional tests;
*
`yii2_basic_acceptance`
- for acceptance tests.
Then update databases by applying migrations:
```
codeception/bin/yii_acceptance migrate
codeception/bin/yii_functional migrate
codeception/bin/yii_unit migrate
```
4.
Build the test suites:
```
codecept build
```
3
.
In order to be able to run acceptance tests you need to start a webserver. The simplest way is to use PHP built in
5
.
In order to be able to run acceptance tests you need to start a webserver. The simplest way is to use PHP built in
webserver. In the
`web`
directory execute the following:
```
php -S localhost:8080
```
4
.
Now you can run the tests with the following commands:
6
.
Now you can run the tests with the following commands:
```
# run all available tests
...
...
apps/basic/tests/codeception/bin/yii_acceptance
View file @
f5ee8e45
...
...
@@ -14,6 +14,13 @@ $config = yii\helpers\ArrayHelper::merge(
require
(
YII_APP_BASE_PATH
.
'/config/console.php'
),
require
(
__DIR__
.
'/../config/config.php'
),
[
'controllerMap'
=>
[
'fixture'
=>
[
'class'
=>
'yii\faker\FixtureController'
,
'fixtureDataPath'
=>
dirname
(
__DIR__
)
.
'fixtures'
,
'templatePath'
=>
dirname
(
__DIR__
)
.
'templates'
],
],
'components'
=>
[
'db'
=>
[
'dsn'
=>
'mysql:host=localhost;dbname=yii2_basic_acceptance'
,
...
...
apps/basic/tests/codeception/bin/yii_functional
View file @
f5ee8e45
...
...
@@ -14,6 +14,13 @@ $config = yii\helpers\ArrayHelper::merge(
require
(
YII_APP_BASE_PATH
.
'/config/console.php'
),
require
(
__DIR__
.
'/../config/config.php'
),
[
'controllerMap'
=>
[
'fixture'
=>
[
'class'
=>
'yii\faker\FixtureController'
,
'fixtureDataPath'
=>
dirname
(
__DIR__
)
.
'fixtures'
,
'templatePath'
=>
dirname
(
__DIR__
)
.
'templates'
],
],
'components'
=>
[
'db'
=>
[
'dsn'
=>
'mysql:host=localhost;dbname=yii2_basic_functional'
,
...
...
apps/basic/tests/codeception/bin/yii_unit
View file @
f5ee8e45
...
...
@@ -14,6 +14,13 @@ $config = yii\helpers\ArrayHelper::merge(
require
(
YII_APP_BASE_PATH
.
'/config/console.php'
),
require
(
__DIR__
.
'/../config/config.php'
),
[
'controllerMap'
=>
[
'fixture'
=>
[
'class'
=>
'yii\faker\FixtureController'
,
'fixtureDataPath'
=>
dirname
(
__DIR__
)
.
'fixtures'
,
'templatePath'
=>
dirname
(
__DIR__
)
.
'templates'
],
],
'components'
=>
[
'db'
=>
[
'dsn'
=>
'mysql:host=localhost;dbname=yii2_basic_unit'
,
...
...
apps/basic/tests/codeception/fixtures/.gitignore
0 → 100644
View file @
f5ee8e45
*
!.gitignore
\ No newline at end of file
apps/basic/tests/codeception/templates/.gitignore
0 → 100644
View file @
f5ee8e45
*
!.gitignore
\ No newline at end of file
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