Pantheon\Terminus\UnitTests\Commands\SSHKey\ListCommandTest::testSSHKeysList PHP Method

testSSHKeysList() public method

Tests the ssh-key:list command
public testSSHKeysList ( )
    public function testSSHKeysList()
    {
        $keys = [['id' => '79e7e210bdf335bb8651a46b9a8417ab', 'key' => 'ssh-rsa xxxxxxx [email protected]'], ['id' => '27a7a11ab9d2acbf91063410546ef980', 'key' => 'ssh-rsa yyyyyyy [email protected]']];
        $output = [['id' => '79e7e210bdf335bb8651a46b9a8417ab', 'hex' => '79:e7:e2:10:bd:f3:35:bb:86:51:a4:6b:9a:84:17:ab', 'comment' => '[email protected]'], ['id' => '27a7a11ab9d2acbf91063410546ef980', 'hex' => '27:a7:a1:1a:b9:d2:ac:bf:91:06:34:10:54:6e:f9:80', 'comment' => '[email protected]']];
        $collection = new SSHKeys(['user' => $this->user]);
        $this->ssh_keys->method('all')->willReturn([new SSHKey((object) $keys[0], ['collection' => $collection]), new SSHKey((object) $keys[1], ['collection' => $collection])]);
        $this->logger->expects($this->never())->method($this->anything());
        $out = $this->command->listSSHKeys();
        $this->assertInstanceOf(RowsOfFields::class, $out);
        $this->assertEquals($output, $out->getArrayCopy());
    }