Initial commit
This commit is contained in:
11
common/fixtures/AuthAssignmentFixture.php
Normal file
11
common/fixtures/AuthAssignmentFixture.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace common\fixtures;
|
||||
|
||||
use yii\test\ActiveFixture;
|
||||
|
||||
class AuthAssignmentFixture extends ActiveFixture
|
||||
{
|
||||
public $tableName = '{{%auth_assignment}}';
|
||||
public $depends = [UserFixture::class];
|
||||
}
|
||||
11
common/fixtures/UserFixture.php
Normal file
11
common/fixtures/UserFixture.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace common\fixtures;
|
||||
|
||||
use yii\test\ActiveFixture;
|
||||
|
||||
class UserFixture extends ActiveFixture
|
||||
{
|
||||
public $modelClass = 'common\models\User';
|
||||
public $depends = [];
|
||||
}
|
||||
12
common/fixtures/data/auth_assignment.php
Normal file
12
common/fixtures/data/auth_assignment.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
[
|
||||
'item_name' => 'admin',
|
||||
'user_id' => 1,
|
||||
],
|
||||
[
|
||||
'item_name' => 'user',
|
||||
'user_id' => 2,
|
||||
],
|
||||
];
|
||||
22
common/fixtures/data/user.php
Normal file
22
common/fixtures/data/user.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
[
|
||||
//password
|
||||
'password_hash' => '$2y$13$k2hQ8aV/z6V0Y7pRbq1ufOUSaJI7EhNvvTUIoj2s/rxAmgyY95KPa',
|
||||
'email' => 'admin@example.com',
|
||||
'auth_key' => '1',
|
||||
'status' => '1',
|
||||
'created_at' => '1402312317',
|
||||
'updated_at' => '1402312317',
|
||||
],
|
||||
[
|
||||
//password
|
||||
'password_hash' => '$2y$13$k2hQ8aV/z6V0Y7pRbq1ufOUSaJI7EhNvvTUIoj2s/rxAmgyY95KPa',
|
||||
'email' => 'user@example.com',
|
||||
'auth_key' => '1',
|
||||
'status' => '1',
|
||||
'created_at' => '1402312317',
|
||||
'updated_at' => '1402312317',
|
||||
],
|
||||
];
|
||||
Reference in New Issue
Block a user