public function testCreate() { $server = new Server('localhost', 'symlink', 'web/assets', '/assets/%s'); $this->assertSame('localhost', $server->getName()); $this->assertSame('symlink', $server->getInstallerName()); $this->assertSame('web/assets', $server->getDocumentRoot()); $this->assertSame('/assets/%s', $server->getUrlFormat()); $this->assertSame(array(), $server->getParameterValues()); }
private function serverToData(Server $server) { $data = new stdClass(); $data->installer = $server->getInstallerName(); $data->{'document-root'} = $server->getDocumentRoot(); if (Server::DEFAULT_URL_FORMAT !== ($urlFormat = $server->getUrlFormat())) { $data->{'url-format'} = $urlFormat; } if ($parameters = $server->getParameterValues()) { $data->parameters = (object) $parameters; } return $data; }
private function serversEqual(Server $server1, Server $server2) { if ($server1->getName() !== $server2->getName()) { return false; } if ($server1->getInstallerName() !== $server2->getInstallerName()) { return false; } if ($server1->getDocumentRoot() !== $server2->getDocumentRoot()) { return false; } if ($server1->getUrlFormat() !== $server2->getUrlFormat()) { return false; } $parameters1 = $server1->getParameterValues(); $parameters2 = $server2->getParameterValues(); ksort($parameters1); ksort($parameters2); if ($parameters1 !== $parameters2) { return false; } return true; }