Example #1
0
 public function testNoNewEmailAreProcessed()
 {
     $lastPersistedUid = 21;
     $lastFetcherUid = 21;
     $lastUidPersistObject = $this->getMock('K3roulas\\EmailWatcher\\LastUidPersist\\LastUidPersistInterface', array('getLastUid', 'setLastUid'));
     $lastUidPersistObject->expects($this->once())->method('getLastUid')->will($this->returnValue($lastPersistedUid));
     $serverCustom = $this->getMockBuilder('K3roulas\\EmailWatcher\\ServerCustom')->disableOriginalConstructor()->setMethods(array())->getMock();
     $serverCustom->expects($this->never())->method('getMessageUntil');
     $lastUidPersistObject->expects($this->never())->method('setLastUid');
     $serverCustom->expects($this->once())->method('getLastUid')->will($this->returnValue($lastFetcherUid));
     $newEmailWatcher = $this->getMock('K3roulas\\EmailWatcher\\NewEmailWatcherInterface');
     $processor = new Processor($serverCustom, $newEmailWatcher, $lastUidPersistObject, 12);
     $processor->process();
 }
Example #2
0
 /**
  * @throws ParameterException
  */
 public function process()
 {
     if (false === $this->initCalled) {
         throw new \Exception('You must call the method init()');
     }
     $this->processor->process();
 }