|
2 | 2 |
|
3 | 3 | namespace Tatter\Frontend\Bundles; |
4 | 4 |
|
5 | | -use CodeIgniter\Publisher\Publisher; |
6 | | -use Tatter\Frontend\FrontendBundle; |
7 | | -use Tests\Support\TestCase; |
| 5 | +use Tatter\Frontend\Test\BundlesTestCase; |
8 | 6 |
|
9 | 7 | /** |
10 | 8 | * @internal |
11 | 9 | */ |
12 | | -final class BundlesTest extends TestCase |
| 10 | +final class BundlesTest extends BundlesTestCase |
13 | 11 | { |
14 | | - private $didPublish = false; |
15 | | - |
16 | | - /** |
17 | | - * Publishes all files once so they are |
18 | | - * available for bundles. |
19 | | - */ |
20 | | - protected function setUp(): void |
21 | | - { |
22 | | - parent::setUp(); |
23 | | - |
24 | | - // Make sure everything is published |
25 | | - if (! $this->didPublish) { |
26 | | - foreach (Publisher::discover() as $publisher) { |
27 | | - $publisher->publish(); |
28 | | - } |
29 | | - |
30 | | - $this->didPublish = true; |
31 | | - } |
32 | | - } |
33 | | - |
34 | | - /** |
35 | | - * @dataProvider bundleProvider |
36 | | - * |
37 | | - * @param class-string<FrontendBundle> $class |
38 | | - * @param string[] $expectedHeadFiles |
39 | | - * @param string[] $expectedBodyFiles |
40 | | - */ |
41 | | - public function testBundlesFiles(string $class, array $expectedHeadFiles, array $expectedBodyFiles): void |
42 | | - { |
43 | | - $bundle = new $class(); |
44 | | - $head = $bundle->head(); |
45 | | - $body = $bundle->body(); |
46 | | - |
47 | | - foreach ($expectedHeadFiles as $file) { |
48 | | - $this->assertStringContainsString($file, $head); |
49 | | - } |
50 | | - |
51 | | - foreach ($expectedBodyFiles as $file) { |
52 | | - $this->assertStringContainsString($file, $body); |
53 | | - } |
54 | | - } |
55 | | - |
56 | | - public function bundleProvider() |
| 12 | + public function bundleProvider(): array |
57 | 13 | { |
58 | 14 | return [ |
59 | 15 | [ |
|
0 commit comments