false); return $app->io(new Interactor(static::$in, static::$ou)); } public function testConfigAppRootNotSet() { $app = $this->newApp('test', '0.0.1'); $app->add(new ControllerCommand([])); $app->handle(['runway', 'make:controller', 'Test']); $this->assertStringContainsString('app_root not set in .runway-config.json', file_get_contents(static::$ou)); } public function testControllerAlreadyExists() { $app = $this->newApp('test', '0.0.1'); mkdir(__DIR__ . '/controllers/'); file_put_contents(__DIR__ . '/controllers/TestController.php', 'add(new ControllerCommand(['app_root' => 'tests/commands/'])); $app->handle(['runway', 'make:controller', 'Test']); $this->assertStringContainsString('TestController already exists.', file_get_contents(static::$ou)); } public function testCreateController() { $app = $this->newApp('test', '0.0.1'); $app->add(new ControllerCommand(['app_root' => 'tests/commands/'])); $app->handle(['runway', 'make:controller', 'Test']); $this->assertFileExists(__DIR__ . '/controllers/TestController.php'); } }