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
9666bc6c
Commit
9666bc6c
authored
Jan 02, 2014
by
Mark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs fix
parent
60c305fa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
README.md
extensions/yii/faker/README.md
+4
-3
No files found.
extensions/yii/faker/README.md
View file @
9666bc6c
...
...
@@ -36,16 +36,17 @@ To use this extension, simply add the following code in your application config
```
Set valid
```test```
alias in your console config, for example for
```basic```
application template, this should be added
to
```console.php```
config:
```Yii::setAlias('tests', __DIR__ . '/../tests');```
To start using this command you need to be familiar (read guide) for the
Faker
library and
To start using this command you need to be familiar (read guide) for the
[
Faker
](
https://github.com/fzaninotto/Faker
)
library and
generate fixtures template files, according to the given format:
```
php
~~~
#users.php file under template path (by default @tests/unit/fixtures/templates)
return
[
[
'table_column0'
=>
'faker_formatter'
,
...
'table_columnN'
=>
'other_faker_formatter
'table_columnN'
=>
'other_faker_formatter
'
'table_columnN+1'
=>
function
(
$fixture
,
$faker
,
$index
)
{
//set needed fixture fields based on different conditions
return
$fixture
;
...
...
@@ -75,7 +76,7 @@ php yii faker users
In the code above "users" is template name, after this command run, new file named same as template
will be created under the fixtures path (by default
```@tests/unit/fixtures```
) folder.
You can generate fixtures for all templates by specifying keyword
"all_fixtures"
You can generate fixtures for all templates by specifying keyword
```all_fixtures```
.
```
php
php
yii
faker
/
generate
all_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