Exemplo n.º 1
-2
 public function testMetadataIsPopped()
 {
     $this->sqsClient->expects($this->once())->method('receiveMessage')->will($this->returnValue(array('Messages' => array(array('Body' => json_encode(array('content' => serialize('aa'), 'metadata' => array('__name__' => 'MyClass', 'foo' => 'bar'))), 'MessageId' => 'id_123', 'ReceiptHandle' => 'receipt_123', 'MD5OfBody' => 'funny')))));
     $this->jobPluginManager->expects($this->once())->method('get')->with('MyClass')->will($this->returnValue(new Asset\SimpleJob()));
     $job = $this->sqsQueue->pop();
     $this->assertInstanceOf('SlmQueueSqsTest\\Asset\\SimpleJob', $job);
     $this->assertEquals('aa', $job->getContent());
     $this->assertEquals(array('__id__' => 'id_123', '__name__' => 'MyClass', 'receiptHandle' => 'receipt_123', 'md5' => 'funny', 'foo' => 'bar'), $job->getMetadata());
 }