|
@@ -3,33 +3,10 @@
|
|
|
namespace fphammerle\yii2\auth\clientcert\tests;
|
|
|
|
|
|
use \fphammerle\helpers\ArrayHelper;
|
|
|
-use \fphammerle\yii2\auth\clientcert\Authenticator;
|
|
|
|
|
|
-class ClientCertAuthTest extends \PHPUnit_Framework_TestCase
|
|
|
+class UserTest extends TestCase
|
|
|
{
|
|
|
- public function mockApplication()
|
|
|
- {
|
|
|
- $app = new \yii\web\Application([
|
|
|
- 'id' => 'yii2-client-cert-auth-test',
|
|
|
- 'basePath' => __DIR__,
|
|
|
- // 'vendorPath' => dirname(__DIR__) . '/vendor',
|
|
|
- 'components' => [
|
|
|
- 'db' => [
|
|
|
- 'class' => '\yii\db\Connection',
|
|
|
- 'dsn' => 'sqlite::memory:',
|
|
|
- ],
|
|
|
- 'user' => [
|
|
|
- 'identityClass' => models\User::className(),
|
|
|
- ],
|
|
|
- ],
|
|
|
- ]);
|
|
|
- $this->assertEquals([], $app->db->getSchema()->getTableNames());
|
|
|
- (new migrations\CreateUserTable)->up();
|
|
|
- $this->assertNull($app->user->getIdentity());
|
|
|
- return $app;
|
|
|
- }
|
|
|
-
|
|
|
- public function testCreateUser()
|
|
|
+ public function testCreateModel()
|
|
|
{
|
|
|
$app = $this->mockApplication();
|
|
|
(new models\User('a'))->save();
|