public function testListMappingsOfNonExistingDefaultServer() { $this->serverManager->expects($this->any())->method('hasServer')->willReturnMap(array(array('localhost', false), array('example.com', false))); $this->serverManager->expects($this->never())->method('getServer'); $this->assetManager->expects($this->once())->method('getAssetMappings')->willReturn(array(new AssetMapping('/app/public', 'localhost', '/', Uuid::fromString(self::UUID1)), new AssetMapping('/acme/blog/public', 'example.com', '/blog', Uuid::fromString(self::UUID2)), new AssetMapping('/acme/profiler/public', 'localhost', '/profiler', Uuid::fromString(self::UUID3)))); $args = self::$listCommand->parseArgs(new StringArgs('')); $expected = <<<EOF The following public resources are disabled since their server does not exist: Server localhost e81b32 /app/public / 49cfdf /acme/profiler/public /profiler Server example.com 33dbec /acme/blog/public /blog Use "puli server add <name> <document-root>" to add a server. EOF; $this->assertSame(0, $this->handler->handleList($args, $this->io)); $this->assertSame($expected, $this->io->fetchOutput()); $this->assertEmpty($this->io->fetchErrors()); }
/** * @expectedException \Puli\Manager\Api\Server\NoSuchServerException */ public function testDeleteServerFailsIfNotFound() { $this->serverManager->expects($this->once())->method('hasServer')->with('localhost')->willReturn(false); $this->serverManager->expects($this->never())->method('removeServer'); $args = self::$deleteCommand->parseArgs(new StringArgs('localhost')); $this->handler->handleDelete($args); }