Exemplo n.º 1
0
 /**
  * Set up the command
  *
  * @covers ImboCli\Command\AddPublicKey::__construct
  */
 public function setUp()
 {
     $this->adapter = $this->getMock('Imbo\\Auth\\AccessControl\\Adapter\\MutableAdapterInterface');
     $this->command = new AddPublicKey();
     $this->command->setConfig(['accessControl' => $this->adapter]);
     $application = new Application();
     $application->add($this->command);
 }
Exemplo n.º 2
0
 /**
  * @expectedException RuntimeException
  * @expectedExceptionMessage The configured access control adapter is not mutable
  * @covers ImboCli\Command\AddPublicKey::getAclAdapter
  */
 public function testThrowsOnImmutableAdapter()
 {
     $command = new AddPublicKey();
     $command->setConfig(['accessControl' => $this->getMock('Imbo\\Auth\\AccessControl\\Adapter\\AdapterInterface')]);
     $commandTester = new CommandTester($command);
     $commandTester->execute(['publicKey' => 'foo']);
 }