File tree 2 files changed +38
-1
lines changed
2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ use Mockery as m ;
4
+ use Illuminate \Container \Container ;
5
+ use Illuminate \Support \Traits \CapsuleManagerTrait ;
6
+
7
+ class SupportCapsuleManagerTraitTest extends \PHPUnit_Framework_TestCase {
8
+
9
+ use CapsuleManagerTrait;
10
+
11
+ public function tearDown ()
12
+ {
13
+ m::close ();
14
+ }
15
+
16
+ public function testSetupContainerForCapsule ()
17
+ {
18
+ $ this ->container = null ;
19
+ $ app = new Container ;
20
+
21
+ $ this ->assertNull ($ this ->setupContainer ($ app ));
22
+ $ this ->assertEquals ($ app , $ this ->getContainer ());
23
+ $ this ->assertInstanceOf ('\Illuminate\Support\Fluent ' , $ app ['config ' ]);
24
+ }
25
+
26
+
27
+ public function testSetupContainerForCapsuleWhenConfigIsBound ()
28
+ {
29
+ $ this ->container = null ;
30
+ $ app = new Container ;
31
+ $ app ['config ' ] = m::mock ('\Illuminate\Config\Repository ' );
32
+
33
+ $ this ->assertNull ($ this ->setupContainer ($ app ));
34
+ $ this ->assertEquals ($ app , $ this ->getContainer ());
35
+ $ this ->assertInstanceOf ('\Illuminate\Config\Repository ' , $ app ['config ' ]);
36
+ }
37
+ }
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ public function testRegisterMacro()
28
28
}
29
29
30
30
31
- public function testResgisterMacroAndCallWithoutStatic ()
31
+ public function testRegisterMacroAndCallWithoutStatic ()
32
32
{
33
33
$ macroTrait = $ this ->macroTrait ;
34
34
$ macroTrait ::macro (__CLASS__ , function () { return 'Taylor ' ; });
You can’t perform that action at this time.
0 commit comments