@@ -6,29 +6,45 @@ class BladeUseTest extends AbstractBladeTestCase
6
6
{
7
7
public function testUseStatementsAreCompiled ()
8
8
{
9
- $ string = "Foo @use('SomeNamespace\SomeClass', 'Foo') bar " ;
10
9
$ expected = "Foo <?php use \SomeNamespace\SomeClass as Foo; ?> bar " ;
10
+
11
+ $ string = "Foo @use('SomeNamespace\SomeClass', 'Foo') bar " ;
12
+ $ this ->assertEquals ($ expected , $ this ->compiler ->compileString ($ string ));
13
+
14
+ $ string = "Foo @use(SomeNamespace\SomeClass, Foo) bar " ;
11
15
$ this ->assertEquals ($ expected , $ this ->compiler ->compileString ($ string ));
12
16
}
13
17
14
18
public function testUseStatementsWithoutAsAreCompiled ()
15
19
{
16
- $ string = "Foo @use('SomeNamespace\SomeClass') bar " ;
17
20
$ expected = "Foo <?php use \SomeNamespace\SomeClass; ?> bar " ;
21
+
22
+ $ string = "Foo @use('SomeNamespace\SomeClass') bar " ;
23
+ $ this ->assertEquals ($ expected , $ this ->compiler ->compileString ($ string ));
24
+
25
+ $ string = "Foo @use(SomeNamespace\SomeClass) bar " ;
18
26
$ this ->assertEquals ($ expected , $ this ->compiler ->compileString ($ string ));
19
27
}
20
28
21
29
public function testUseStatementsWithBackslashAtBeginningAreCompiled ()
22
30
{
23
- $ string = "Foo @use('\SomeNamespace\SomeClass') bar " ;
24
31
$ expected = "Foo <?php use \SomeNamespace\SomeClass; ?> bar " ;
32
+
33
+ $ string = "Foo @use('\SomeNamespace\SomeClass') bar " ;
34
+ $ this ->assertEquals ($ expected , $ this ->compiler ->compileString ($ string ));
35
+
36
+ $ string = "Foo @use(\SomeNamespace\SomeClass) bar " ;
25
37
$ this ->assertEquals ($ expected , $ this ->compiler ->compileString ($ string ));
26
38
}
27
39
28
40
public function testUseStatementsWithBackslashAtBeginningAndAliasedAreCompiled ()
29
41
{
30
- $ string = "Foo @use('\SomeNamespace\SomeClass', 'Foo') bar " ;
31
42
$ expected = "Foo <?php use \SomeNamespace\SomeClass as Foo; ?> bar " ;
43
+
44
+ $ string = "Foo @use('\SomeNamespace\SomeClass', 'Foo') bar " ;
45
+ $ this ->assertEquals ($ expected , $ this ->compiler ->compileString ($ string ));
46
+
47
+ $ string = "Foo @use(\SomeNamespace\SomeClass, Foo) bar " ;
32
48
$ this ->assertEquals ($ expected , $ this ->compiler ->compileString ($ string ));
33
49
}
34
50
}
0 commit comments