diff --git a/app/commands/PostInstallController.php b/app/commands/PostInstallController.php index 82937d8..9331c2a 100644 --- a/app/commands/PostInstallController.php +++ b/app/commands/PostInstallController.php @@ -2,9 +2,9 @@ namespace app\commands; -use SideKit\Config\ConfigKit; use Yii; use yii\console\Controller; +use Da\Config\Configuration; class PostInstallController extends Controller { @@ -14,6 +14,6 @@ class PostInstallController extends Controller public function actionGenerateCookieValidation() { $key = Yii::$app->security->generateRandomString(); - ConfigKit::env()->changeEnvironmentFile(['APP_COOKIE_VALIDATION_KEY' => $key]); + Configuration::env()->changeEnvironmentFile(['APP_COOKIE_VALIDATION_KEY' => $key]); } } diff --git a/app/models/User.php b/app/models/User.php index f8bdddf..bd53569 100644 --- a/app/models/User.php +++ b/app/models/User.php @@ -2,7 +2,7 @@ namespace app\models; -class User extends \yii\base\Object implements \yii\web\IdentityInterface +class User extends \yii\base\BaseObject implements \yii\web\IdentityInterface { public $id; public $username; diff --git a/bootstrap/aliases.php b/bootstrap/aliases.php index c19269f..2070af6 100644 --- a/bootstrap/aliases.php +++ b/bootstrap/aliases.php @@ -1,6 +1,7 @@ getBasePath() . DIRECTORY_SEPARATOR . '../tests'); -Yii::setAlias('@root', ConfigKit::config()->getRootPath()); -Yii::setAlias('@web', ConfigKit::config()->getBasePath() . DIRECTORY_SEPARATOR . '../public'); +Yii::setAlias('@tests', Configuration::app()->getBasePath() . DIRECTORY_SEPARATOR . '../tests'); +Yii::setAlias('@root', Configuration::app()->getRootPath()); +Yii::setAlias('@web', Configuration::app()->getBasePath() . DIRECTORY_SEPARATOR . '../public'); diff --git a/bootstrap/console.php b/bootstrap/console.php index 7126ab3..0620b02 100644 --- a/bootstrap/console.php +++ b/bootstrap/console.php @@ -1,6 +1,6 @@ build('console', ConfigKit::env()->get('CONFIG_USE_CACHE')); +$config = Configuration::app()->build('console', Configuration::env()->get('CONFIG_USE_CACHE')); $app = new Application($config); diff --git a/bootstrap/sidekit-test.php b/bootstrap/sidekit-test.php index 1d7ef22..370f0ce 100644 --- a/bootstrap/sidekit-test.php +++ b/bootstrap/sidekit-test.php @@ -1,6 +1,6 @@ useConfigurationBuilder($builder) ->useRootPath($root); @@ -35,7 +35,7 @@ * as the following is specified. */ -// ConfigKit::config() +// Configuration::app() // ->useConfigurationBuilder($builder) // ->useRootPath($root) // ->useBasePath($root . '/app') @@ -55,8 +55,7 @@ * the appropriate .env file in the path specified in SideKit. */ -ConfigKit::env()->loadEnvironmentFrom('.env.test')->load(); - +Configuration::env()->loadEnvironmentFrom('.env.test')->load(); /* * -------------------------------------------------------------------------- * Initialize constants required by Yii @@ -65,8 +64,8 @@ * I cannot get rid of them. They are being used within core. Oh well... */ -defined('YII_DEBUG') or define('YII_DEBUG', ConfigKit::env()->get('YII_DEBUG')); -defined('YII_ENV') or define('YII_ENV', ConfigKit::env()->get('YII_ENV')); +defined('YII_DEBUG') or define('YII_DEBUG', Configuration::env()->get('YII_DEBUG')); +defined('YII_ENV') or define('YII_ENV', Configuration::env()->get('YII_ENV')); /* * -------------------------------------------------------------------------- diff --git a/bootstrap/sidekit.php b/bootstrap/sidekit.php index 1eaa236..9f2c713 100644 --- a/bootstrap/sidekit.php +++ b/bootstrap/sidekit.php @@ -1,6 +1,6 @@ useConfigurationBuilder($builder) ->useRootPath($root); @@ -35,7 +35,7 @@ * as the following is specified. */ -// ConfigKit::config() +// Configuration::app() // ->useConfigurationBuilder($builder) // ->useRootPath($root) // ->useBasePath($root . '/app') @@ -55,7 +55,7 @@ * the appropriate .env file in the path specified in SideKit. */ -ConfigKit::env()->load(); +Configuration::env()->load(); /* * -------------------------------------------------------------------------- @@ -65,8 +65,8 @@ * I cannot get rid of them. They are being used within core. Oh well... */ -defined('YII_DEBUG') or define('YII_DEBUG', ConfigKit::env()->get('YII_DEBUG')); -defined('YII_ENV') or define('YII_ENV', ConfigKit::env()->get('YII_ENV')); +defined('YII_DEBUG') or define('YII_DEBUG', Configuration::env()->get('YII_DEBUG')); +defined('YII_ENV') or define('YII_ENV', Configuration::env()->get('YII_ENV')); /* * -------------------------------------------------------------------------- diff --git a/bootstrap/test.php b/bootstrap/test.php index 81c998f..0e1df1f 100644 --- a/bootstrap/test.php +++ b/bootstrap/test.php @@ -1,6 +1,6 @@ useDirectory($root . DIRECTORY_SEPARATOR . 'config'); -ConfigKit::config() +Configuration::app() ->useConfigurationBuilder($builder) ->useRootPath($root); @@ -37,7 +37,7 @@ * the appropriate .env file in the path specified in SideKit. */ -ConfigKit::env()->loadEnvironmentFrom('.env.test')->overload(); +Configuration::env()->loadEnvironmentFrom('.env.test')->overload(); /* * -------------------------------------------------------------------------- @@ -50,7 +50,7 @@ * variables. */ -$config = ConfigKit::config()->build('test', ConfigKit::env()->get('CONFIG_USE_CACHE')); +$config = Configuration::app()->build('test', Configuration::env()->get('CONFIG_USE_CACHE')); $app = new Application($config); diff --git a/bootstrap/web.php b/bootstrap/web.php index 0eaf82d..cb52406 100644 --- a/bootstrap/web.php +++ b/bootstrap/web.php @@ -1,6 +1,6 @@ build('web', ConfigKit::env()->get('CONFIG_USE_CACHE')); +$config = Configuration::app()->build('web', Configuration::env()->get('CONFIG_USE_CACHE')); $app = new Application($config); /* diff --git a/codeception.yml b/codeception.yml index eb9bc59..a38e6c1 100644 --- a/codeception.yml +++ b/codeception.yml @@ -4,8 +4,8 @@ paths: log: tests/_output data: tests/_data helpers: tests/_support +bootstrap: _bootstrap.php settings: - bootstrap: _bootstrap.php memory_limit: 1024M colors: true log: true diff --git a/composer.json b/composer.json index 9bb3af6..09e4794 100644 --- a/composer.json +++ b/composer.json @@ -26,16 +26,20 @@ "vlucas/phpdotenv": "^2.4", "league/container": "^2.2", "symfony/finder": "^3.1", - "2amigos/yii2-config-kit": "^1.0" + "2amigos/yii2-config-kit": "^2.0" }, "require-dev": { "yiisoft/yii2-debug": "~2.0.0", "yiisoft/yii2-gii": "~2.0.0", "yiisoft/yii2-faker": "~2.0.0", "yiisoft/yii2-shell": "~2.0.0", - "codeception/base": "^2.2.3", - "codeception/verify": "~0.3.1", - "codeception/specify": "~0.4.3", + "codeception/codeception": "^4.1", + "codeception/verify": "^2.1", + "codeception/specify": "^1.4", + "codeception/module-asserts": "^1.3", + "codeception/module-yii2": "^1.1", + "codeception/module-phpbrowser": "^1.0", + "codeception/module-filesystem": "^1.0", "facebook/webdriver": "^1.2", "squizlabs/php_codesniffer": "^2.7", "friendsofphp/php-cs-fixer": "^2.0", diff --git a/config/codeception/app.php b/config/codeception/app.php index 6b425df..446709d 100644 --- a/config/codeception/app.php +++ b/config/codeception/app.php @@ -43,6 +43,6 @@ * advantage of its loaded configuration values */ -use SideKit\Config\ConfigKit; +use Da\Config\Configuration; -return ConfigKit::config()->build('test', ConfigKit::env()->get('CONFIG_USE_CACHE')); +return Configuration::app()->build('test', Configuration::env()->get('CONFIG_USE_CACHE')); diff --git a/config/console/app.php b/config/console/app.php index bf5bcbe..446b1de 100644 --- a/config/console/app.php +++ b/config/console/app.php @@ -1,6 +1,6 @@ 'application-id-console', - 'basePath' => ConfigKit::config()->getBasePath(), + 'basePath' => Configuration::app()->getBasePath(), - 'vendorPath' => ConfigKit::config()->getVendorPath(), + 'vendorPath' => Configuration::app()->getVendorPath(), - 'runtimePath' => ConfigKit::config()->getRuntimePath(), + 'runtimePath' => Configuration::app()->getRuntimePath(), - 'language' => ConfigKit::env()->get('APP_LANGUAGE'), + 'language' => Configuration::env()->get('APP_LANGUAGE'), 'bootstrap' => ['log'], diff --git a/config/console/components/db.php b/config/console/components/db.php index af96d35..63f98da 100644 --- a/config/console/components/db.php +++ b/config/console/components/db.php @@ -1,6 +1,6 @@ 'yii\db\Connection', - 'dsn' => ConfigKit::env()->get('DATABASE_DSN'), + 'dsn' => Configuration::env()->get('DATABASE_DSN'), - 'username' => ConfigKit::env()->get('DATABASE_USER'), + 'username' => Configuration::env()->get('DATABASE_USER'), - 'password' => ConfigKit::env()->get('DATABASE_PASSWORD'), + 'password' => Configuration::env()->get('DATABASE_PASSWORD'), - 'charset' => ConfigKit::env()->get('DATABASE_CHARSET'), + 'charset' => Configuration::env()->get('DATABASE_CHARSET'), - 'tablePrefix' => ConfigKit::env()->get('DATABASE_TABLE_PREFIX'), + 'tablePrefix' => Configuration::env()->get('DATABASE_TABLE_PREFIX'), ]; diff --git a/config/console/components/log.php b/config/console/components/log.php index e54eee7..2196ab7 100644 --- a/config/console/components/log.php +++ b/config/console/components/log.php @@ -1,10 +1,10 @@ ConfigKit::env()->get('YII_TRACE_LEVEL'), + 'traceLevel' => Configuration::env()->get('YII_TRACE_LEVEL'), /* * -------------------------------------------------------------------------- diff --git a/config/test/app.php b/config/test/app.php index 2c3621d..97a4f72 100644 --- a/config/test/app.php +++ b/config/test/app.php @@ -1,6 +1,6 @@ 'application-id-tests', - 'basePath' => ConfigKit::config()->getBasePath(), + 'basePath' => Configuration::app()->getBasePath(), - 'vendorPath' => ConfigKit::config()->getVendorPath(), + 'vendorPath' => Configuration::app()->getVendorPath(), - 'runtimePath' => ConfigKit::config()->getRuntimePath(), + 'runtimePath' => Configuration::app()->getRuntimePath(), - 'language' => ConfigKit::env()->get('APP_LANGUAGE'), + 'language' => Configuration::env()->get('APP_LANGUAGE'), 'aliases' => [ '@bower' => '@vendor/bower-asset', diff --git a/config/test/components/assetManager.php b/config/test/components/assetManager.php index 7ea2360..bb38193 100644 --- a/config/test/components/assetManager.php +++ b/config/test/components/assetManager.php @@ -1,9 +1,8 @@ ConfigKit::config()->getRootPath() . '/public/assets', + 'basePath' => Configuration::app()->getRootPath() . '/public/assets', ]; diff --git a/config/test/components/db.php b/config/test/components/db.php index af96d35..63f98da 100644 --- a/config/test/components/db.php +++ b/config/test/components/db.php @@ -1,6 +1,6 @@ 'yii\db\Connection', - 'dsn' => ConfigKit::env()->get('DATABASE_DSN'), + 'dsn' => Configuration::env()->get('DATABASE_DSN'), - 'username' => ConfigKit::env()->get('DATABASE_USER'), + 'username' => Configuration::env()->get('DATABASE_USER'), - 'password' => ConfigKit::env()->get('DATABASE_PASSWORD'), + 'password' => Configuration::env()->get('DATABASE_PASSWORD'), - 'charset' => ConfigKit::env()->get('DATABASE_CHARSET'), + 'charset' => Configuration::env()->get('DATABASE_CHARSET'), - 'tablePrefix' => ConfigKit::env()->get('DATABASE_TABLE_PREFIX'), + 'tablePrefix' => Configuration::env()->get('DATABASE_TABLE_PREFIX'), ]; diff --git a/config/test/components/request.php b/config/test/components/request.php index e85b229..c042b40 100644 --- a/config/test/components/request.php +++ b/config/test/components/request.php @@ -1,10 +1,9 @@ ConfigKit::env()->get('APP_COOKIE_VALIDATION_KEY'), + 'cookieValidationKey' => Configuration::env()->get('APP_COOKIE_VALIDATION_KEY'), 'enableCsrfValidation' => false, diff --git a/config/web/app.php b/config/web/app.php index c697467..0ca4ef2 100644 --- a/config/web/app.php +++ b/config/web/app.php @@ -1,6 +1,6 @@ 'application-id', - 'basePath' => ConfigKit::config()->getBasePath(), + 'basePath' => Configuration::app()->getBasePath(), - 'vendorPath' => ConfigKit::config()->getVendorPath(), + 'vendorPath' => Configuration::app()->getVendorPath(), - 'runtimePath' => ConfigKit::config()->getRuntimePath(), + 'runtimePath' => Configuration::app()->getRuntimePath(), - 'language' => ConfigKit::env()->get('APP_LANGUAGE'), + 'language' => Configuration::env()->get('APP_LANGUAGE'), 'bootstrap' => ['log'], diff --git a/config/web/components/db.php b/config/web/components/db.php index af96d35..63f98da 100644 --- a/config/web/components/db.php +++ b/config/web/components/db.php @@ -1,6 +1,6 @@ 'yii\db\Connection', - 'dsn' => ConfigKit::env()->get('DATABASE_DSN'), + 'dsn' => Configuration::env()->get('DATABASE_DSN'), - 'username' => ConfigKit::env()->get('DATABASE_USER'), + 'username' => Configuration::env()->get('DATABASE_USER'), - 'password' => ConfigKit::env()->get('DATABASE_PASSWORD'), + 'password' => Configuration::env()->get('DATABASE_PASSWORD'), - 'charset' => ConfigKit::env()->get('DATABASE_CHARSET'), + 'charset' => Configuration::env()->get('DATABASE_CHARSET'), - 'tablePrefix' => ConfigKit::env()->get('DATABASE_TABLE_PREFIX'), + 'tablePrefix' => Configuration::env()->get('DATABASE_TABLE_PREFIX'), ]; diff --git a/config/web/components/log.php b/config/web/components/log.php index e54eee7..2196ab7 100644 --- a/config/web/components/log.php +++ b/config/web/components/log.php @@ -1,10 +1,10 @@ ConfigKit::env()->get('YII_TRACE_LEVEL'), + 'traceLevel' => Configuration::env()->get('YII_TRACE_LEVEL'), /* * -------------------------------------------------------------------------- diff --git a/config/web/components/request.php b/config/web/components/request.php index 1e547ca..604edce 100644 --- a/config/web/components/request.php +++ b/config/web/components/request.php @@ -1,7 +1,7 @@ ConfigKit::env()->get('APP_COOKIE_VALIDATION_KEY'), + 'cookieValidationKey' => Configuration::env()->get('APP_COOKIE_VALIDATION_KEY'), ]; diff --git a/src/App/Configuration/ConfigurationBuilder.php b/src/App/Configuration/ConfigurationBuilder.php index 266e63d..ffed59e 100644 --- a/src/App/Configuration/ConfigurationBuilder.php +++ b/src/App/Configuration/ConfigurationBuilder.php @@ -1,10 +1,11 @@ filesystem = $filesystem ?: ConfigKit::filesystem(); + $this->filesystem = $filesystem ?: Configuration::fs(); } /** @@ -41,7 +42,7 @@ public function __construct(Filesystem $filesystem = null) * * @throws InvalidConfigException */ - public function useDirectory($path) + public function useDirectory(string $path): ConfigurationBuilderInterface { if (!is_dir($path)) { throw new InvalidConfigException('Configuration folder path seems to be incorrect.'); @@ -54,7 +55,7 @@ public function useDirectory($path) /** * @inheritdoc */ - public function useCache($value) + public function useCache($value): ConfigurationBuilderInterface { $this->useCache = $value; @@ -64,7 +65,7 @@ public function useCache($value) /** * @inheritdoc */ - public function useCacheDirectory($path) + public function useCacheDirectory($path): ConfigurationBuilderInterface { if (!$this->filesystem->isDirectory($path)) { $this->filesystem->makeDirectory($path, 0755, false, true); @@ -78,7 +79,7 @@ public function useCacheDirectory($path) /** * @inheritdoc */ - public function build($name) + public function build(string $name): array { $cached = $this->cacheDirectory . DIRECTORY_SEPARATOR . $name . '-config.php'; @@ -90,7 +91,7 @@ public function build($name) $sections = $this->buildSections($this->configPath); $config = ArrayHelper::merge($config, $sections); - $config = ArrayHelper::merge($config, $this->buildEnv($name, ConfigKit::env()->get('YII_ENV'))); + $config = ArrayHelper::merge($config, $this->buildEnv($name, Configuration::env()->get('YII_ENV'))); $this->cacheFile($cached, $config); @@ -109,7 +110,7 @@ protected function buildEnv($name, $env) { $config = []; $sections = []; - $configPath = ConfigKit::config()->getEnvConfigPath() . DIRECTORY_SEPARATOR . $name; + $configPath = Configuration::app()->getEnvConfigPath() . DIRECTORY_SEPARATOR . $name; $path = $configPath . DIRECTORY_SEPARATOR . $env; if ($this->filesystem->exists($path)) { @@ -127,7 +128,7 @@ protected function buildEnv($name, $env) /* * Local configuration always overrides */ - $local = ConfigKit::str()->is($env, 'local') + $local = Configuration::str()->is($env, 'local') ? $sections // local env? is an override : ArrayHelper::merge($sections, $this->buildEnv($name, 'local')); @@ -166,6 +167,7 @@ protected function buildSections($path) foreach ($directories as $directory => $path) { foreach ($this->filesystem->allFiles($path, '/^.*\.php/i') as $basename => $filePath) { + $basename = pathinfo($basename, PATHINFO_FILENAME); $config = $this->filesystem->getRequiredFileValue($filePath); if (is_array($config)) { $sections[$directory][$basename] = $config; diff --git a/tests/bin/yii b/tests/bin/yii index ca21810..657a533 100755 --- a/tests/bin/yii +++ b/tests/bin/yii @@ -35,7 +35,7 @@ require __DIR__ . '/../../bootstrap/sidekit-test.php'; require __DIR__ . '/../../bootstrap/aliases.php'; -use SideKit\Config\ConfigKit; +use Da\Config\Configuration; use yii\helpers\ArrayHelper; use yii\console\Application; @@ -49,7 +49,7 @@ use yii\console\Application; * unnecessary code on the entry script. */ -$config = ConfigKit::config()->build('console', ConfigKit::env()->get('CONFIG_USE_CACHE')); +$config = Configuration::app()->build('console', Configuration::env()->get('CONFIG_USE_CACHE')); /* * -------------------------------------------------------------------------- diff --git a/tests/unit/SideKitTest.php b/tests/unit/SideKitTest.php index 69bdef1..dc877aa 100644 --- a/tests/unit/SideKitTest.php +++ b/tests/unit/SideKitTest.php @@ -1,6 +1,6 @@ get('DATABASE_DSN_DB'))->equals('yii2_tests'); + verify_that(Configuration::env()->get('DATABASE_DSN_DB'))->equals('yii2_tests'); } } diff --git a/tests/unit/models/ContactFormTest.php b/tests/unit/models/ContactFormTest.php index 81a67e9..5c0a561 100644 --- a/tests/unit/models/ContactFormTest.php +++ b/tests/unit/models/ContactFormTest.php @@ -16,7 +16,7 @@ public function testEmailIsSentOnContact() { /** @var ContactForm $model */ $this->model = $this->getMockBuilder('app\models\ContactForm') - ->setMethods(['validate']) + ->onlyMethods(['validate']) ->getMock(); $this->model->expects($this->once()) @@ -30,16 +30,16 @@ public function testEmailIsSentOnContact() 'body' => 'body of current message', ]; - expect_that($this->model->contact('admin@example.com')); + verify_that($this->model->contact('admin@example.com')); // using Yii2 module actions to check email was sent $this->tester->seeEmailIsSent(); $emailMessage = $this->tester->grabLastSentEmail(); - expect('valid email is sent', $emailMessage)->isInstanceOf('yii\mail\MessageInterface'); - expect($emailMessage->getTo())->hasKey('admin@example.com'); - expect($emailMessage->getFrom())->hasKey('tester@example.com'); - expect($emailMessage->getSubject())->equals('very important letter subject'); - expect($emailMessage->toString())->contains('body of current message'); + verify_that($emailMessage)->instanceOf('yii\mail\MessageInterface'); + verify_that($emailMessage->getTo())->arrayHasKey('admin@example.com'); + verify_that($emailMessage->getFrom())->arrayHasKey('tester@example.com'); + verify_that($emailMessage->getSubject())->equals('very important letter subject'); + verify_that($emailMessage->toString())->stringContainsString('body of current message'); } } diff --git a/tests/unit/models/LoginFormTest.php b/tests/unit/models/LoginFormTest.php index 85a7ffa..c4d01ce 100644 --- a/tests/unit/models/LoginFormTest.php +++ b/tests/unit/models/LoginFormTest.php @@ -20,8 +20,8 @@ public function testLoginNoUser() 'password' => 'not_existing_password', ]); - expect_not($this->model->login()); - expect_that(\Yii::$app->user->isGuest); + verify($this->model->login())->false(); + verify(\Yii::$app->user->isGuest)->true(); } public function testLoginWrongPassword() @@ -31,9 +31,9 @@ public function testLoginWrongPassword() 'password' => 'wrong_password', ]); - expect_not($this->model->login()); - expect_that(\Yii::$app->user->isGuest); - expect($this->model->errors)->hasKey('password'); + verify($this->model->login())->false(); + verify(\Yii::$app->user->isGuest)->true(); + verify($this->model->errors)->arrayHasKey('password'); } public function testLoginCorrect() @@ -43,8 +43,8 @@ public function testLoginCorrect() 'password' => 'demo', ]); - expect_that($this->model->login()); - expect_not(\Yii::$app->user->isGuest); - expect($this->model->errors)->hasntKey('password'); + verify($this->model->login())->true(); + verify(\Yii::$app->user->isGuest)->false(); + verify($this->model->errors)->arrayHasNotKey('password'); } } diff --git a/tests/unit/models/UserTest.php b/tests/unit/models/UserTest.php index fc06929..518fa0a 100644 --- a/tests/unit/models/UserTest.php +++ b/tests/unit/models/UserTest.php @@ -2,41 +2,42 @@ namespace tests\models; use app\models\User; +use yii\web\IdentityInterface; class UserTest extends \Codeception\Test\Unit { public function testFindUserById() { - expect_that($user = User::findIdentity(100)); - expect($user->username)->equals('admin'); + verify_that($user = User::findIdentity(100))->instanceOf('yii\web\IdentityInterface'); + verify($user->username)->equals('admin'); - expect_not(User::findIdentity(999)); + verify_that(User::findIdentity(999))->null(); } public function testFindUserByAccessToken() { - expect_that($user = User::findIdentityByAccessToken('100-token')); - expect($user->username)->equals('admin'); + verify_that($user = User::findIdentityByAccessToken('100-token'))->instanceOf('yii\web\IdentityInterface'); + verify($user->username)->equals('admin'); - expect_not(User::findIdentityByAccessToken('non-existing')); + verify_that(User::findIdentityByAccessToken('non-existing'))->null(); } public function testFindUserByUsername() { - expect_that($user = User::findByUsername('admin')); - expect_not(User::findByUsername('not-admin')); + verify_that($user = User::findByUsername('admin'))->instanceOf('yii\web\IdentityInterface'); + verify_that(User::findByUsername('not-admin'))->null(); } /** * @depends testFindUserByUsername */ - public function testValidateUser($user) + public function testValidateUser() { $user = User::findByUsername('admin'); - expect_that($user->validateAuthKey('test100key')); - expect_not($user->validateAuthKey('test102key')); + verify_that($user->validateAuthKey('test100key'))->true(); + verify_that($user->validateAuthKey('test102key'))->false(); - expect_that($user->validatePassword('admin')); - expect_not($user->validatePassword('123456')); + verify_that($user->validatePassword('admin'))->true(); + verify_that($user->validatePassword('123456'))->false(); } }