Phue\Test\Command\CreateScheduleTest::setUp PHP Метод

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

Set up
public setUp ( )
    public function setUp()
    {
        // Ensure proper timezone
        date_default_timezone_set('UTC');
        // Mock client
        $this->mockClient = $this->getMock('\\Phue\\Client', array('getUsername', 'getTransport'), array('127.0.0.1'));
        // Mock transport
        $this->mockTransport = $this->getMock('\\Phue\\Transport\\TransportInterface', array('sendRequest'));
        // Stub client's getUsername method
        $this->mockClient->expects($this->any())->method('getUsername')->will($this->returnValue('abcdefabcdef01234567890123456789'));
        // Stub client's getTransport method
        $this->mockClient->expects($this->any())->method('getTransport')->will($this->returnValue($this->mockTransport));
        // Mock actionable command
        $this->mockCommand = $this->getMock('\\Phue\\Command\\ActionableInterface', array('getActionableParams'));
        // Stub command's getActionableParams method
        $this->mockCommand->expects($this->any())->method('getActionableParams')->will($this->returnValue(array('address' => '/thing/value', 'method' => 'POST', 'body' => 'Dummy')));
    }