fixing some tests
This commit is contained in:
14
tests/_fixtures/ProfileFixture.php
Normal file
14
tests/_fixtures/ProfileFixture.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace tests\_fixtures;
|
||||
|
||||
use yii\test\ActiveFixture;
|
||||
|
||||
class ProfileFixture extends ActiveFixture
|
||||
{
|
||||
public $modelClass = 'Da\User\Model\Profile';
|
||||
|
||||
public $depends = [
|
||||
'tests\_fixtures\UserFixture'
|
||||
];
|
||||
}
|
||||
14
tests/_fixtures/TokenFixture.php
Normal file
14
tests/_fixtures/TokenFixture.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace tests\_fixtures;
|
||||
|
||||
use yii\test\ActiveFixture;
|
||||
|
||||
class TokenFixture extends ActiveFixture
|
||||
{
|
||||
public $modelClass = 'Da\User\Model\Token';
|
||||
|
||||
public $depends = [
|
||||
'tests\_fixtures\UserFixture'
|
||||
];
|
||||
}
|
||||
10
tests/_fixtures/UserFixture.php
Normal file
10
tests/_fixtures/UserFixture.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace tests\_fixtures;
|
||||
|
||||
use yii\test\ActiveFixture;
|
||||
|
||||
class UserFixture extends ActiveFixture
|
||||
{
|
||||
public $modelClass = 'Da\User\Model\User';
|
||||
}
|
||||
10
tests/_fixtures/data/profile.php
Normal file
10
tests/_fixtures/data/profile.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
$time = time();
|
||||
|
||||
return [
|
||||
'user' => [
|
||||
'user_id' => 1,
|
||||
'name' => 'John Doe',
|
||||
],
|
||||
];
|
||||
32
tests/_fixtures/data/token.php
Normal file
32
tests/_fixtures/data/token.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Da\User\Model\Token;
|
||||
|
||||
$time = time();
|
||||
|
||||
return [
|
||||
'confirmation' => [
|
||||
'user_id' => 2,
|
||||
'code' => 'NO2aCmBIjFQX624xmAc3VBu7Th3NJoa6',
|
||||
'type' => Token::TYPE_CONFIRMATION,
|
||||
'created_at' => $time,
|
||||
],
|
||||
'expired_confirmation' => [
|
||||
'user_id' => 3,
|
||||
'code' => 'qxYa315rqRgCOjYGk82GFHMEAV3T82AX',
|
||||
'type' => Token::TYPE_CONFIRMATION,
|
||||
'created_at' => $time - 86401,
|
||||
],
|
||||
'expired_recovery' => [
|
||||
'user_id' => 5,
|
||||
'code' => 'a5839d0e73b9c525942c2f59e88c1aaf',
|
||||
'type' => Token::TYPE_RECOVERY,
|
||||
'created_at' => $time - 21601,
|
||||
],
|
||||
'recovery' => [
|
||||
'user_id' => 6,
|
||||
'code' => '6f5d0dad53ef73e6ba6f01a441c0e602',
|
||||
'type' => Token::TYPE_RECOVERY,
|
||||
'created_at' => $time,
|
||||
],
|
||||
];
|
||||
59
tests/_fixtures/data/user.php
Normal file
59
tests/_fixtures/data/user.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
$time = time();
|
||||
|
||||
return [
|
||||
'user' => [
|
||||
'username' => 'user',
|
||||
'email' => 'user@example.com',
|
||||
'password_hash' => '$2y$13$qY.ImaYBppt66qez6B31QO92jc5DYVRzo5NxM1ivItkW74WsSG6Ui',
|
||||
'auth_key' => '39HU0m5lpjWtqstFVGFjj6lFb7UZDeRq',
|
||||
'created_at' => $time,
|
||||
'updated_at' => $time,
|
||||
'confirmed_at' => $time,
|
||||
],
|
||||
'unconfirmed' => [
|
||||
'username' => 'joe',
|
||||
'email' => 'joe@example.com',
|
||||
'password_hash' => '$2y$13$CIH1LSMPzU9xDCywt3QO8uovAu2axp8hwuXVa72oI.1G/USsGyMBS',
|
||||
'auth_key' => 'mhh1A6KfqQLmHP-MiWN0WB0M90Q2u5OE',
|
||||
'created_at' => $time,
|
||||
'updated_at' => $time,
|
||||
],
|
||||
'unconfirmed_with_expired_token' => [
|
||||
'username' => 'john',
|
||||
'email' => 'john@example.com',
|
||||
'password_hash' => '$2y$13$qY.ImaYBppt66qez6B31QO92jc5DYVRzo5NxM1ivItkW74WsSG6Ui',
|
||||
'auth_key' => 'h6OS9csJbZEOW59ZILmJxU6bCiqVno9A',
|
||||
'created_at' => $time - 86401,
|
||||
'updated_at' => $time - 86401,
|
||||
],
|
||||
'blocked' => [
|
||||
'username' => 'steven',
|
||||
'email' => 'steven@example.com',
|
||||
'password_hash' => '$2y$13$qY.ImaYBppt66qez6B31QO92jc5DYVRzo5NxM1ivItkW74WsSG6Ui',
|
||||
'auth_key' => 'TnXTrtLdj-YJBlG2A6jFHJreKgbsLYCa',
|
||||
'created_at' => $time,
|
||||
'updated_at' => $time,
|
||||
'blocked_at' => $time,
|
||||
'confirmed_at' => $time,
|
||||
],
|
||||
'user_with_expired_recovery_token' => [
|
||||
'username' => 'andrew',
|
||||
'email' => 'andrew@example.com',
|
||||
'password_hash' => '$2y$13$qY.ImaYBppt66qez6B31QO92jc5DYVRzo5NxM1ivItkW74WsSG6Ui',
|
||||
'auth_key' => 'qxYa315rqRgCOjYGk82GFHMEAV3T82AX',
|
||||
'created_at' => $time - 21601,
|
||||
'updated_at' => $time - 21601,
|
||||
'confirmed_at' => $time - 21601,
|
||||
],
|
||||
'user_with_recovery_token' => [
|
||||
'username' => 'alex',
|
||||
'email' => 'alex@example.com',
|
||||
'password_hash' => '$2y$13$qY.ImaYBppt66qez6B31QO92jc5DYVRzo5NxM1ivItkW74WsSG6Ui',
|
||||
'auth_key' => 'zQh1A65We0AmHPOMiWN0WB0M90Q24ziU',
|
||||
'created_at' => $time,
|
||||
'updated_at' => $time,
|
||||
'confirmed_at' => $time,
|
||||
],
|
||||
];
|
||||
Reference in New Issue
Block a user