-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Paul M. Jones
committed
Jan 30, 2013
1 parent
6a419ae
commit c79e8d3
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
namespace Aura\Cli; | ||
|
||
use Aura\Framework\Test\WiringAssertionsTrait; | ||
|
||
class WiringTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
use WiringAssertionsTrait; | ||
|
||
protected function setUp() | ||
{ | ||
$this->loadDi(); | ||
} | ||
|
||
public function testServices() | ||
{ | ||
$this->assertGet('cli_context', 'Aura\Cli\Context'); | ||
$this->assertGet('cli_stdio', 'Aura\Cli\Stdio'); | ||
} | ||
|
||
public function testInstances() | ||
{ | ||
$this->assertNewInstance('Aura\Cli\AbstractCommand', 'Aura\Cli\MockCommand'); | ||
$this->assertNewInstance('Aura\Cli\Context'); | ||
$this->assertNewInstance('Aura\Cli\ExceptionFactory'); | ||
$this->assertNewInstance('Aura\Cli\Getopt'); | ||
$this->assertNewInstance('Aura\Cli\Stdio'); | ||
} | ||
|
||
public function testTranslatedExceptions() | ||
{ | ||
$factory = $this->di->newInstance('Aura\Cli\ExceptionFactory'); | ||
$exception = $factory->newInstance('ERR_OPTION_NOT_DEFINED'); | ||
$expect = "The option '{option}' is not recognized."; | ||
$actual = $exception->getMessage(); | ||
$this->assertSame($expect, $actual); | ||
} | ||
} |