/** * @covers DmMailer\Manager\QueueItem */ public function testTrackQueueItemReturnsTrueOnSuccess() { $queueItemMock = $this->getMockBuilder('DmMailer\\Entity\\QueueItem')->disableOriginalConstructor()->setMethods(['setIsTracked'])->getMock(); $this->queueItemRepoMock->expects($this->any())->method('getOneBySecurityKey')->will($this->returnValue($queueItemMock)); $this->queueItemRepoMock->expects($this->any())->method('getOneBySecurityKey'); $actualResult = $this->sut->trackQueueItem('securityKey'); $this->assertTrue($actualResult); }
/** * @return \Zend\Http\PhpEnvironment\Response */ public function trackAction() { if (!$this->manager->trackQueueItem($this->params('securityKey'))) { return ''; } return $this->manager->getImageResponse($this->getResponse()); }