Phue\Test\Command\GetUsersTest::testFoundUsers PHP Method

testFoundUsers() public method

Test: Found users
public testFoundUsers ( )
    public function testFoundUsers()
    {
        // Mock transport results
        $mockTransportResults = (object) array('whitelist' => array('someusername' => new \stdClass(), 'anotherusername' => new \stdClass()));
        // Stub transport's sendRequest usage
        $this->mockTransport->expects($this->once())->method('sendRequest')->with($this->equalTo("/api/{$this->mockClient->getUsername()}/config"))->will($this->returnValue($mockTransportResults));
        // Send command and get response
        $response = $this->getUsers->send($this->mockClient);
        // Ensure we have an array of Users
        $this->assertInternalType('array', $response);
        $this->assertContainsOnlyInstancesOf('\\Phue\\User', $response);
    }