Phue\Test\Command\CreateRuleTest::testSend PHP Method

testSend() public method

Test: Send
public testSend ( )
    public function testSend()
    {
        // Mock client
        $mockClient = Mockery::mock('\\Phue\\Client', array('getUsername' => 'abcdefabcdef01234567890123456789'))->makePartial();
        // Mock client commands
        $mockClient->shouldReceive('getTransport->sendRequest')->andReturn((object) array('id' => '5'));
        $x = new CreateRule('test');
        $command = $x->addCondition(Mockery::mock('\\Phue\\Condition')->makePartial())->addAction(Mockery::mock('\\Phue\\Command\\ActionableInterface')->shouldIgnoreMissing());
        $this->assertEquals('5', $command->send($mockClient));
    }