Skip to content

Commit

Permalink
Add test for CapsuleManagerTrait and fixes a typo.
Browse files Browse the repository at this point in the history
Signed-off-by: crynobone <[email protected]>
  • Loading branch information
crynobone committed Jul 21, 2014
1 parent c7794d8 commit 0d4b6ee
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
37 changes: 37 additions & 0 deletions tests/Support/SupportCapsuleManagerTraitTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

use Mockery as m;
use Illuminate\Container\Container;
use Illuminate\Support\Traits\CapsuleManagerTrait;

class SupportCapsuleManagerTraitTest extends \PHPUnit_Framework_TestCase {

use CapsuleManagerTrait;

public function tearDown()
{
m::close();
}

public function testSetupContainerForCapsule()
{
$this->container = null;
$app = new Container;

$this->assertNull($this->setupContainer($app));
$this->assertEquals($app, $this->getContainer());
$this->assertInstanceOf('\Illuminate\Support\Fluent', $app['config']);
}


public function testSetupContainerForCapsuleWhenConfigIsBound()
{
$this->container = null;
$app = new Container;
$app['config'] = m::mock('\Illuminate\Config\Repository');

$this->assertNull($this->setupContainer($app));
$this->assertEquals($app, $this->getContainer());
$this->assertInstanceOf('\Illuminate\Config\Repository', $app['config']);
}
}
2 changes: 1 addition & 1 deletion tests/Support/SupportMacroTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testRegisterMacro()
}


public function testResgisterMacroAndCallWithoutStatic()
public function testRegisterMacroAndCallWithoutStatic()
{
$macroTrait = $this->macroTrait;
$macroTrait::macro(__CLASS__, function() { return 'Taylor'; });
Expand Down

0 comments on commit 0d4b6ee

Please sign in to comment.