Phue\Test\Command\GetSensorsTest::testFoundSensors PHP Method

testFoundSensors() public method

Test: Found sensors
public testFoundSensors ( )
    public function testFoundSensors()
    {
        // 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()}/sensors"))->will($this->returnValue($mockTransportResults));
        // Send command and get response
        $response = $this->getSensors->send($this->mockClient);
        // Ensure we have an array of Sensors
        $this->assertInternalType('array', $response);
        $this->assertContainsOnlyInstancesOf('\\Phue\\Sensor', $response);
    }