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
20 changed files
with
115 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ addons: | |
- op | ||
|
||
php: | ||
- 7.2 | ||
- 7.3 | ||
- nightly | ||
|
||
|
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
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
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
imports: | ||
- { resource: security.yml } | ||
- { resource: oauth2_security.yml } | ||
|
||
framework: | ||
test: ~ | ||
|
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2014-2019 Spomky-Labs | ||
* | ||
* This software may be modified and distributed under the terms | ||
* of the MIT license. See the LICENSE file for details. | ||
*/ | ||
|
||
namespace OAuth2Framework\ServerBundle\Tests\Functional; | ||
|
||
use Doctrine\ORM\EntityManager; | ||
use Symfony\Bundle\FrameworkBundle\Client; | ||
use Symfony\Bundle\FrameworkBundle\Console\Application; | ||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | ||
use Symfony\Component\Console\Input\StringInput; | ||
use Symfony\Component\DependencyInjection\ContainerInterface; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
class DataFixtureTestCase extends WebTestCase | ||
{ | ||
/** @var Application $application */ | ||
protected static $application; | ||
|
||
/** @var Client $client */ | ||
protected $client; | ||
|
||
/** @var ContainerInterface $container */ | ||
protected $container; | ||
|
||
/** @var EntityManager $entityManager */ | ||
protected $entityManager; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function setUp(): void | ||
{ | ||
self::runCommand('doctrine:database:drop --force'); | ||
self::runCommand('doctrine:database:create'); | ||
self::runCommand('doctrine:schema:create'); | ||
self::runCommand('doctrine:fixtures:load --append --no-interaction'); | ||
|
||
$this->client = static::createClient(); | ||
$this->container = $this->client->getContainer(); | ||
$this->entityManager = $this->container->get('doctrine.orm.entity_manager'); | ||
|
||
parent::setUp(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function tearDown() | ||
{ | ||
self::runCommand('doctrine:database:drop --force'); | ||
|
||
parent::tearDown(); | ||
|
||
$this->entityManager->close(); | ||
$this->entityManager = null; // avoid memory leaks | ||
} | ||
|
||
protected static function runCommand($command) | ||
{ | ||
$command = sprintf('%s --quiet', $command); | ||
|
||
return self::getApplication()->run(new StringInput($command)); | ||
} | ||
|
||
protected static function getApplication() | ||
{ | ||
if (null === self::$application) { | ||
$client = static::createClient(); | ||
|
||
self::$application = new Application($client->getKernel()); | ||
self::$application->setAutoExit(false); | ||
} | ||
|
||
return self::$application; | ||
} | ||
} |