File tree Expand file tree Collapse file tree 5 files changed +25
-133
lines changed Expand file tree Collapse file tree 5 files changed +25
-133
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 18
18
use Symfony \Component \DependencyInjection \ContainerBuilder ;
19
19
use Symfony \Component \HttpKernel \Kernel ;
20
20
use Symfony \UX \Notify \NotifyBundle ;
21
+ use Symfony \UX \StimulusBundle \StimulusBundle ;
21
22
22
23
/**
23
24
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
26
27
*/
27
28
class TwigAppKernel extends Kernel
28
29
{
29
- use AppKernelTrait;
30
-
31
30
public function registerBundles (): iterable
32
31
{
33
32
yield new FrameworkBundle ();
34
33
yield new TwigBundle ();
34
+ yield new StimulusBundle ();
35
35
yield new MercureBundle ();
36
36
yield new NotifyBundle ();
37
37
}
@@ -57,4 +57,25 @@ public function registerContainerConfiguration(LoaderInterface $loader)
57
57
$ container ->setAlias ('test.notify.twig_runtime ' , 'notify.twig_runtime ' )->setPublic (true );
58
58
});
59
59
}
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
+ }
60
81
}
Original file line number Diff line number Diff line change 24
24
*/
25
25
class NotifyBundleTest extends TestCase
26
26
{
27
- /**
28
- * @dataProvider provideKernels
29
- */
30
- public function testBootKernel (Kernel $ kernel )
27
+ public function testBootKernel ()
31
28
{
29
+ $ kernel = new TwigAppKernel ('test ' , true );
32
30
$ kernel ->boot ();
33
31
$ this ->assertArrayHasKey ('NotifyBundle ' , $ kernel ->getBundles ());
34
32
}
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
- }
45
33
}
You can’t perform that action at this time.
0 commit comments