Pantheon\Terminus\UnitTests\Commands\SSHKey\SSHKeyCommandTest::setUp PHP Method

setUp() protected method

This method is called before a test is executed.
protected setUp ( )
    protected function setUp()
    {
        parent::setUp();
        $this->ssh_keys = $this->getMockBuilder(SSHKeys::class)->disableOriginalConstructor()->getMock();
        $this->user = $this->getMockBuilder(User::class)->disableOriginalConstructor()->getMock();
        $this->user->expects($this->any())->method('getSSHKeys')->willReturn($this->ssh_keys);
        $this->session = $this->getMockBuilder(Session::class)->disableOriginalConstructor()->getMock();
        $this->session->method('getUser')->willReturn($this->user);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 protected function setUp()
 {
     parent::setUp();
     $this->command = new ListCommand($this->getConfig());
     $this->command->setSession($this->session);
     $this->command->setLogger($this->logger);
 }
SSHKeyCommandTest