|
1 | 1 | <?php
|
2 | 2 |
|
| 3 | +use Illuminate\Support\Facades\Facade; |
3 | 4 | use Roots\Acorn\Tests\Test\TestCase;
|
4 | 5 |
|
5 | 6 | use function Roots\asset;
|
|
8 | 9 |
|
9 | 10 | uses(TestCase::class);
|
10 | 11 |
|
| 12 | +beforeEach(function () { |
| 13 | + Facade::setFacadeApplication(new \Roots\Acorn\Application); |
| 14 | +}); |
| 15 | + |
11 | 16 | it('asset() can access the default manifest', function () {
|
12 | 17 | $app = new \Roots\Acorn\Application;
|
| 18 | + |
13 | 19 | $app->singleton('config', fn () => new \Illuminate\Config\Repository([
|
14 | 20 | 'assets' => [
|
15 | 21 | 'default' => 'app',
|
|
29 | 35 | ],
|
30 | 36 | ],
|
31 | 37 | ]));
|
| 38 | + |
32 | 39 | $app->register(\Roots\Acorn\Assets\AssetsServiceProvider::class);
|
33 | 40 |
|
34 | 41 | assertMatchesSnapshot(asset('app.js')->uri());
|
35 | 42 | });
|
36 | 43 |
|
37 | 44 | it('asset() can access a specified manifest', function () {
|
38 | 45 | $app = new \Roots\Acorn\Application;
|
| 46 | + |
39 | 47 | $app->singleton('config', fn () => new \Illuminate\Config\Repository([
|
40 | 48 | 'assets' => [
|
41 | 49 | 'default' => 'app',
|
|
55 | 63 | ],
|
56 | 64 | ],
|
57 | 65 | ]));
|
| 66 | + |
58 | 67 | $app->register(\Roots\Acorn\Assets\AssetsServiceProvider::class);
|
59 | 68 |
|
60 | 69 | assertMatchesSnapshot(asset('editor.js', 'editor')->uri());
|
|
81 | 90 | ],
|
82 | 91 | ],
|
83 | 92 | ]));
|
| 93 | + |
84 | 94 | $app->register(\Roots\Acorn\Assets\AssetsServiceProvider::class);
|
85 | 95 |
|
86 | 96 | assertMatchesSnapshot(bundle('app')->js()->toJson());
|
87 | 97 | });
|
88 | 98 |
|
89 | 99 | it('bundle() can access a specified manifest', function () {
|
90 | 100 | $app = new \Roots\Acorn\Application;
|
| 101 | + |
91 | 102 | $app->singleton('config', fn () => new \Illuminate\Config\Repository([
|
92 | 103 | 'assets' => [
|
93 | 104 | 'default' => 'app',
|
|
107 | 118 | ],
|
108 | 119 | ],
|
109 | 120 | ]));
|
| 121 | + |
110 | 122 | $app->register(\Roots\Acorn\Assets\AssetsServiceProvider::class);
|
111 | 123 |
|
112 | 124 | assertMatchesSnapshot(bundle('editor', 'editor')->js()->toJson());
|
|
0 commit comments