Author: Espen Hovlandsdal (espen@hovlandsdal.com)
Inheritance: extends ImboCli\Command\Command
コード例 #1
0
ファイル: AddPublicKeyTest.php プロジェクト: imbo/imbo
 /**
  * @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']);
 }
コード例 #2
0
ファイル: AddPublicKeyTest.php プロジェクト: imbo/imbo
 /**
  * @covers ImboCli\Command\AddPublicKey::execute
  * @covers ImboCli\Command\AddPublicKey::askForAnotherAclRule
  * @covers ImboCli\Command\AddPublicKey::askForCustomResources
  */
 public function testPromtpsForListOfCustomResourcesIfOptionIsSelected()
 {
     $allResources = Resource::getAllResources();
     sort($allResources);
     $this->adapter->expects($this->once())->method('addAccessRule')->with('foo', ['resources' => ['foo.read', 'bar.write'], 'users' => '*']);
     $this->adapter->expects($this->once())->method('addKeyPair')->with('foo', 'bar');
     $helper = $this->command->getHelper('question');
     $helper->setInputStream($this->getInputStream(['4', 'foo.read,bar.write', '*', 'n']));
     $commandTester = new CommandTester($this->command);
     $commandTester->execute(['publicKey' => 'foo', 'privateKey' => 'bar']);
 }