Skip to content

Commit 0f5a57c

Browse files
committed
fixing tests
1 parent 452bcf3 commit 0f5a57c

File tree

5 files changed

+25
-133
lines changed

5 files changed

+25
-133
lines changed

src/Notify/tests/Kernel/AppKernelTrait.php

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/Notify/tests/Kernel/EmptyAppKernel.php

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/Notify/tests/Kernel/FrameworkAppKernel.php

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/Notify/tests/Kernel/TwigAppKernel.php

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Symfony\Component\DependencyInjection\ContainerBuilder;
1919
use Symfony\Component\HttpKernel\Kernel;
2020
use Symfony\UX\Notify\NotifyBundle;
21+
use Symfony\UX\StimulusBundle\StimulusBundle;
2122

2223
/**
2324
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
@@ -26,12 +27,11 @@
2627
*/
2728
class TwigAppKernel extends Kernel
2829
{
29-
use AppKernelTrait;
30-
3130
public function registerBundles(): iterable
3231
{
3332
yield new FrameworkBundle();
3433
yield new TwigBundle();
34+
yield new StimulusBundle();
3535
yield new MercureBundle();
3636
yield new NotifyBundle();
3737
}
@@ -57,4 +57,25 @@ public function registerContainerConfiguration(LoaderInterface $loader)
5757
$container->setAlias('test.notify.twig_runtime', 'notify.twig_runtime')->setPublic(true);
5858
});
5959
}
60+
61+
public function getCacheDir(): string
62+
{
63+
return $this->createTmpDir('cache');
64+
}
65+
66+
public function getLogDir(): string
67+
{
68+
return $this->createTmpDir('logs');
69+
}
70+
71+
private function createTmpDir(string $type): string
72+
{
73+
$dir = sys_get_temp_dir().'/notify_bundle/'.uniqid($type.'_', true);
74+
75+
if (!file_exists($dir)) {
76+
mkdir($dir, 0777, true);
77+
}
78+
79+
return $dir;
80+
}
6081
}

src/Notify/tests/NotifyBundleTest.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,10 @@
2424
*/
2525
class NotifyBundleTest extends TestCase
2626
{
27-
/**
28-
* @dataProvider provideKernels
29-
*/
30-
public function testBootKernel(Kernel $kernel)
27+
public function testBootKernel()
3128
{
29+
$kernel = new TwigAppKernel('test', true);
3230
$kernel->boot();
3331
$this->assertArrayHasKey('NotifyBundle', $kernel->getBundles());
3432
}
35-
36-
/**
37-
* @return iterable<Kernel>
38-
*/
39-
public function provideKernels(): iterable
40-
{
41-
yield 'empty' => [new EmptyAppKernel('test', true)];
42-
yield 'framework' => [new FrameworkAppKernel('test', true)];
43-
yield 'twig' => [new TwigAppKernel('test', true)];
44-
}
4533
}

0 commit comments

Comments
 (0)