public function testRepeatingIntervalInvalidArgument()
 {
     $this->setExpectedException(InvalidArgumentException::class);
     $this->sendParameter->setRepeatingInterval('fndfnfbd');
 }
Exemple #2
0
 public function testScheduleMessage()
 {
     $time = time() + 3600;
     $repeting = 60;
     $message = new Message();
     $expectedParams = new SendParameters();
     $expectedParams->setSchedule($time);
     $expectedParams->setRepeatingInterval($repeting);
     $mockAdapter = $this->getMock(Adapter\AdapterInterface::class);
     $mockAdapter->expects($this->any())->method('getAvailableSendParams')->will($this->returnValue([SendParameters::SCHEDULE, SendParameters::REPEATING_INTERVAL]));
     /** @var $mockAdapter Adapter\AdapterInterface */
     $q = new Queue('test', $mockAdapter);
     /** @var $mockAdapter \PHPUnit_Framework_MockObject_MockObject */
     $mockAdapter->expects($this->any())->method('sendMessage')->with($this->equalTo($q), $this->equalTo($message), $this->equalTo($expectedParams))->will($this->returnValue($message));
     $this->assertTrue($q->isSendParamSupported(SendParameters::SCHEDULE));
     $this->assertTrue($q->isSendParamSupported(SendParameters::REPEATING_INTERVAL));
     $this->assertSame($message, $q->schedule($message, $time, $repeting));
 }