Phue\Test\Command\GetRulesTest::testFoundRules PHP Method

testFoundRules() public method

Test: Found rules
public testFoundRules ( )
    public function testFoundRules()
    {
        // Mock transport results
        $mockTransportResults = (object) array(1 => new \stdClass(), 2 => new \stdClass());
        // Stub transport's sendRequest usage
        $this->mockTransport->expects($this->once())->method('sendRequest')->with($this->equalTo("/api/{$this->mockClient->getUsername()}/rules"))->will($this->returnValue($mockTransportResults));
        // Send command and get response
        $response = $this->getRules->send($this->mockClient);
        // Ensure we have an array of Rules
        $this->assertInternalType('array', $response);
        $this->assertContainsOnlyInstancesOf('\\Phue\\Rule', $response);
    }