-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
65 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Doctrine Configuration | ||
doctrine: | ||
dbal: | ||
# These variables come from parameters.yml. There, the values are read from environment variables | ||
# and can also be set directly in the parameters.yml file. | ||
driver: '%database_driver%' | ||
host: '%database_host%' | ||
path: '%database_path%' | ||
port: '%database_port%' | ||
dbname: '%database_name%' | ||
user: '%database_user%' | ||
password: '%database_password%' | ||
charset: UTF8 | ||
|
||
orm: | ||
auto_generate_proxy_classes: '%kernel.debug%' | ||
naming_strategy: doctrine.orm.naming_strategy.underscore | ||
auto_mapping: true | ||
mappings: | ||
PhpList\Core\Domain\Model: | ||
is_bundle: false | ||
type: attribute | ||
dir: '%kernel.project_dir%/src/Domain/Model/' | ||
prefix: 'PhpList\Core\Domain\Model\' | ||
controller_resolver: | ||
auto_mapping: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,15 +13,17 @@ | |
use PhpList\Core\TestingSupport\Traits\DatabaseTestTrait; | ||
use PhpList\Core\TestingSupport\Traits\SimilarDatesAssertionTrait; | ||
use PhpList\Core\Tests\Integration\Domain\Repository\Fixtures\AdministratorFixture; | ||
use PhpList\Core\Tests\Integration\Domain\Repository\Fixtures\AdministratorTokenWithAdministratorFixture; | ||
use PhpList\Core\Tests\Integration\Domain\Repository\Fixtures\DetachedAdministratorTokenFixture; | ||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | ||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | ||
|
||
/** | ||
* Testcase. | ||
* | ||
* @author Oliver Klee <[email protected]> | ||
*/ | ||
class AdministratorTokenRepositoryTest extends KernelTestCase | ||
class AdministratorTokenRepositoryTest extends WebTestCase | ||
{ | ||
use DatabaseTestTrait; | ||
use SimilarDatesAssertionTrait; | ||
|
@@ -47,8 +49,7 @@ public function testFindReadsModelFromDatabase() | |
$this->loadFixtures([DetachedAdministratorTokenFixture::class]); | ||
|
||
$id = 1; | ||
// prePersist | ||
$creationDate = new DateTime(); | ||
$creationDate = new DateTime('2017-12-06 17:41:40'); | ||
$expiry = new DateTime('2017-06-22 16:43:29'); | ||
$key = 'cfdf64eecbbf336628b0f3071adba762'; | ||
|
||
|
@@ -62,21 +63,6 @@ public function testFindReadsModelFromDatabase() | |
self::assertSame($key, $model->getKey()); | ||
} | ||
|
||
// public function testCreatesAdministratorAssociationAsProxy() | ||
// { | ||
// $this->loadFixtures([AdministratorFixture::class, AdministratorTokenWithAdministratorFixture::class]); | ||
// | ||
// $tokenId = 1; | ||
// $administratorId = 1; | ||
// /** @var AdministratorToken $model */ | ||
// $model = $this->repository->find($tokenId); | ||
// $administrator = $model->getAdministrator(); | ||
// | ||
// self::assertInstanceOf(Administrator::class, $administrator); | ||
// self::assertInstanceOf(Proxy::class, $administrator); | ||
// self::assertSame($administratorId, $administrator->getId()); | ||
// } | ||
|
||
public function testCreationDateOfExistingModelStaysUnchangedOnUpdate() | ||
{ | ||
$this->loadFixtures([DetachedAdministratorTokenFixture::class]); | ||
|
@@ -138,17 +124,16 @@ public function testFindOneUnexpiredByKeyNotFindsUnexpiredTokenWithNonMatchingKe | |
self::assertNull($model); | ||
} | ||
|
||
// public function testRemoveExpiredRemovesExpiredToken() | ||
// { | ||
// $this->loadFixtures([DetachedAdministratorTokenFixture::class]); | ||
// | ||
// $idOfExpiredToken = 1; | ||
// $this->repository->removeExpired(); | ||
// $this->entityManager->flush(); | ||
// | ||
// $token = $this->repository->find($idOfExpiredToken); | ||
// self::assertNull($token); | ||
// } | ||
public function testRemoveExpiredRemovesExpiredToken() | ||
{ | ||
$this->loadFixtures([DetachedAdministratorTokenFixture::class]); | ||
|
||
$idOfExpiredToken = 1; | ||
$this->repository->removeExpired(); | ||
|
||
$token = $this->repository->find($idOfExpiredToken); | ||
self::assertNull($token); | ||
} | ||
|
||
public function testRemoveExpiredKeepsUnexpiredToken() | ||
{ | ||
|