Phue\Test\Command\CreateGroupTest::testSend PHP Метод

testSend() публичный Метод

Test: Send command
public testSend ( )
    public function testSend()
    {
        $command = new CreateGroup('Dummy', array(2, 3));
        // Stub transport's sendRequest usage
        $this->mockTransport->expects($this->once())->method('sendRequest')->with($this->equalTo("/api/{$this->mockClient->getUsername()}/groups"), $this->equalTo(TransportInterface::METHOD_POST), $this->equalTo((object) array('name' => 'Dummy', 'lights' => array(2, 3))))->will($this->returnValue((object) array('id' => '5')));
        // Send command and get response
        $groupId = $command->send($this->mockClient);
        // Ensure we have a group id
        $this->assertEquals(5, $groupId);
    }