File tree Expand file tree Collapse file tree 2 files changed +0
-29
lines changed
src/Roots/Acorn/Assets/Asset Expand file tree Collapse file tree 2 files changed +0
-29
lines changed Original file line number Diff line number Diff line change 6
6
7
7
class PhpAsset extends Asset
8
8
{
9
- /**
10
- * Get the returned value of the asset
11
- *
12
- * @deprecated since 2.1.2. Use require(), requireOnce(), include() or includeOnce() instead.
13
- *
14
- * @param bool $require
15
- * @param bool $once
16
- * @return mixed
17
- */
18
- public function load ($ require = false , $ once = false )
19
- {
20
- if ($ require ) {
21
- return $ once
22
- ? $ this ->requireOnce ()
23
- : $ this ->require ();
24
- }
25
-
26
- return $ once
27
- ? $ this ->includeOnce ()
28
- : $ this ->include ();
29
- }
30
-
31
9
/**
32
10
* Get the returned value of the asset
33
11
*
Original file line number Diff line number Diff line change 70
70
assertMatchesSnapshot ($ this ->assets ->asset ('bnif.php ' )->requireOnce ());
71
71
});
72
72
73
- it ('can load a php asset ' , function () {
74
- assertMatchesSnapshot ($ this ->assets ->asset ('bnif.php ' )->load (false , false ));
75
- assertMatchesSnapshot ($ this ->assets ->asset ('bnif.php ' )->load (false , true ));
76
- assertMatchesSnapshot ($ this ->assets ->asset ('bnif.php ' )->load (true , false ));
77
- assertMatchesSnapshot ($ this ->assets ->asset ('bnif.php ' )->load (true , true ));
78
- });
79
-
80
73
it ('can fail to include a php asset ' , function () {
81
74
(new PhpAsset (temp ('does/not/exist.php ' ), 'https://kjo.kjo/ ' ))->include ();
82
75
})->throws (FileNotFoundException::class);
You can’t perform that action at this time.
0 commit comments