| 1 | <?php |
||
| 24 | class ConsoleBuilderTest extends \PHPUnit_Framework_TestCase |
||
| 25 | { |
||
| 26 | public function testApplication() |
||
| 27 | { |
||
| 28 | $command = new Command('command'); |
||
| 29 | |||
| 30 | $builder = $this->getMockBuilder(RelationalBuilder::class) |
||
| 31 | ->disableOriginalConstructor() |
||
| 32 | ->getMock(); |
||
| 33 | $builder |
||
| 34 | ->expects(self::once()) |
||
| 35 | ->method('getName') |
||
| 36 | ->will(self::returnValue('command')); |
||
| 37 | $builder |
||
| 38 | ->expects(self::once()) |
||
| 39 | ->method('getConsoleCommands') |
||
| 40 | ->will(self::returnValue([$command])); |
||
| 41 | $builder |
||
| 42 | ->expects(self::once()) |
||
| 43 | ->method('getConsoleHelperSet') |
||
| 44 | ->will(self::returnValue(new HelperSet)); |
||
| 45 | /* @var AbstractManagerBuilder $builder */ |
||
| 46 | |||
| 47 | $consoleBuilder = new ConsoleBuilder(); |
||
| 48 | |||
| 49 | $consoleBuilder->addBuilder($builder); |
||
| 50 | |||
| 51 | $application = $consoleBuilder->getApplication(); |
||
| 52 | self::assertInstanceOf(Application::class, $application); |
||
| 53 | |||
| 54 | self::assertTrue($application->has('command')); |
||
| 55 | } |
||
| 56 | } |
||
| 57 |