/** * Put a repository set of files to homepage url one by one. * * @param string $dir the set of files * * @throws \Exception if $dir is not a directory * * @return SatisHttpClient this SatisHttpClient Instance */ public function putDir($dir) { if (is_dir($dir)) { $finder = $this->httpServer->find($dir); foreach ($finder as $file) { if ($contents = $file->getContents()) { $this->putFile($file->getRelativePathname(), $contents); } } return $this; } throw new \Exception('Error Processing PUT Request of ' . $dir . ' (directory problem)', 3); }
/** * @expectedException Exception * @expectedExceptionCode 4 */ public function testMisconfiguredHttpServer() { $server = new SatisHttpServerInfo(); $server->setNeedAuthentication(true); $this->client = new SatisHttpClient('http://localhost:54715', null, $server); }