Skip to content

Commit

Permalink
Update nyholm/symfony-bundle-test to dev-master for Symfony 6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentchalamon committed Dec 28, 2021
1 parent 25acde5 commit d0a36a1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -46,7 +46,7 @@
"dbrekelmans/bdi": "^1.0",
"doctrine/annotations": "^1.11",
"league/flysystem-bundle": "^1.2 || ^2.0",
"nyholm/symfony-bundle-test": "^1.8",
"nyholm/symfony-bundle-test": "dev-master",
"phpspec/prophecy": "^1.12",
"phpstan/phpstan": "^1.0",
"psr/event-dispatcher": "^1.0",
Expand Down
35 changes: 23 additions & 12 deletions tests/BundleInitializationTest.php
Expand Up @@ -14,26 +14,37 @@
namespace DocusignBundle\Tests;

use DocusignBundle\DocusignBundle;
use Nyholm\BundleTest\BaseBundleTestCase;
use Nyholm\BundleTest\TestKernel;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
use Symfony\Component\HttpKernel\KernelInterface;

/**
* @author Vincent Chalamon <vincentchalamon@gmail.com>
*/
final class BundleInitializationTest extends BaseBundleTestCase
final class BundleInitializationTest extends KernelTestCase
{
protected function getBundleClass(): string
protected static function getKernelClass(): string
{
return DocusignBundle::class;
return TestKernel::class;
}

public function testTheBundleIsBootable(): void
protected static function createKernel(array $options = []): KernelInterface
{
$kernel = $this->createKernel();
$kernel->addConfigFile(__DIR__.'/config/docusign.yml');
$this->bootKernel();
/** @var TestKernel $kernel */
$kernel = parent::createKernel($options);
$kernel->addTestBundle(DocusignBundle::class);
$kernel->handleOptions($options);

return $kernel;
}

$container = $this->getContainer();
public function testTheBundleIsBootable(): void
{
$kernel = self::bootKernel(['config' => static function (TestKernel $kernel): void {
$kernel->addTestConfig(__DIR__.'/config/docusign.yml');
}]);
$container = $kernel->getContainer();

$this->assertFalse($container->has('docusign.grant.embedded'));
$this->assertFalse($container->has('docusign.signature_extractor.embedded'));
Expand All @@ -47,9 +58,9 @@ public function testTheBundleIsNotBootable(string $configFile): void
{
$this->expectException(InvalidConfigurationException::class);

$kernel = $this->createKernel();
$kernel->addConfigFile($configFile);
$this->bootKernel();
self::bootKernel(['config' => static function (TestKernel $kernel) use ($configFile): void {
$kernel->addTestConfig($configFile);
}]);
}

public function getInvalidConfigurationFiles(): array
Expand Down

0 comments on commit d0a36a1

Please sign in to comment.