12345678910111213141516171819202122232425262728 |
- <?php
- namespace fphammerle\yii2\auth\clientcert\tests;
- abstract class TestCase extends \PHPUnit_Framework_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;
- }
- }
|