/**
  * Test create lazy ask password getter
  */
 public function testCreateLazyAskPasswordGetter()
 {
     $lazyGetter = AskPasswordGetter::createLazyGetter();
     $this->assertInstanceOf('Deployer\\Server\\Password\\CallablePasswordGetter', $lazyGetter);
     $context = $this->getMock('Deployer\\Task\\Context', ['getInput', 'getOutput'], [], '', false);
     $context->expects($this->any())->method('getInput')->will($this->returnValue($this->input));
     $context->expects($this->any())->method('getOutput')->will($this->returnValue($this->output));
     // Push own context
     Context::push($context);
     $lazyGetter->getPassword('host', 'user');
     // Pop own context
     Context::pop();
 }
示例#2
0
 protected function tearDown()
 {
     Context::pop();
     unset($this->deployer);
     $this->deployer = null;
 }