示例#1
0
 public function testServerPath()
 {
     $s1 = new Server('localhost', 'julien', '/home/julien/website');
     $s2 = new Server('localhost', 'julien', '/home/julien/website/');
     $this->assertEquals('/home/julien/website/', $s1->getDir());
     $this->assertEquals('/home/julien/website/', $s2->getDir());
 }
示例#2
0
 public function testDeployWithSubscribers()
 {
     $server = new Server('91.121.5.9', 'root', '/var/www/plumbertest', 22);
     $server->setReleasesFolder('/var/www/releases');
     $deployer = $this->getMock('\\Plumber\\Deployer\\NoRsyncDeployer');
     $dispatcher = new \Symfony\Component\EventDispatcher\EventDispatcher();
     $ssh_con = $this->getMock('\\Plumber\\Server\\SshConnection');
     $ssh_con->expects($this->once())->method('execute')->with(sprintf('ln -sf %s %s', $server->getReleasesFolder() . date('YmdHis') . '/', $server->getDir()));
     $plum = new Plumber($deployer, $dispatcher, array(new \Plumber\ReleaseManager($ssh_con)));
     $plum->addServer('prod', $server);
     $plum->deploy('prod', array('dry_run' => false));
 }