Sort of get config to work
This commit is contained in:
@@ -5,11 +5,10 @@ declare(strict_types=1);
|
||||
namespace Pcm\IconBundle\Tests;
|
||||
|
||||
use Pcm\IconBundle\PcmIconBundle;
|
||||
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
|
||||
use Symfony\Component\Config\Loader\LoaderInterface;
|
||||
use Symfony\Component\HttpKernel\Kernel;
|
||||
|
||||
class AppKernel extends Kernel
|
||||
class TestKernel extends Kernel
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
@@ -17,7 +16,6 @@ class AppKernel extends Kernel
|
||||
public function registerBundles(): array
|
||||
{
|
||||
return [
|
||||
new FrameworkBundle(),
|
||||
new PcmIconBundle()
|
||||
];
|
||||
}
|
||||
@@ -27,6 +25,6 @@ class AppKernel extends Kernel
|
||||
*/
|
||||
public function registerContainerConfiguration(LoaderInterface $loader): void
|
||||
{
|
||||
$loader->load(__DIR__.'/services_'.$this->getEnvironment().'.yml');
|
||||
$loader->load(__DIR__.'/../config/packages/pcm_icon.yaml');
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace Pcm\IconBundle\Tests\Twig\Functions;
|
||||
|
||||
use Pcm\IconBundle\Tests\AppKernel;
|
||||
use Pcm\IconBundle\DependencyInjection\PcmIconExtension;
|
||||
use Pcm\IconBundle\Tests\TestKernel;
|
||||
use Pcm\IconBundle\Twig\Functions\IconExtension;
|
||||
use Pcm\IconBundle\Twig\Functions\IconNotFound;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
@@ -20,7 +21,7 @@ class IconExtensionTest extends TestCase
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$kernel = new AppKernel('test', false);
|
||||
$kernel = new TestKernel('test', true);
|
||||
$kernel->boot();
|
||||
$this->icon = $kernel->getContainer()->get('pcm_icon.icon_extension');
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
# This config is only here to stop a deprecation notice for Symfony 7
|
||||
framework:
|
||||
http_method_override: false
|
||||
|
||||
services:
|
||||
pcm_icon.icon_extension:
|
||||
alias: Pcm\IconBundle\Twig\Functions\IconExtension
|
||||
public: true
|
||||
|
||||
Pcm\IconBundle\Twig\Functions\IconExtension:
|
||||
arguments:
|
||||
$directories:
|
||||
- '%kernel.project_dir%/tests/icons'
|
||||
Reference in New Issue
Block a user