Пример #1
0
 public function testCanSaveEntityInDatabase()
 {
     $hydrator = new DoctrineObject($this->entityManager, 'Program\\Entity\\Domain');
     $this->domain = $hydrator->hydrate($this->domainData, new Domain());
     $this->entityManager->persist($this->domain);
     $this->entityManager->flush();
     $this->assertInstanceOf('Program\\Entity\\Domain', $this->domain);
     $this->assertNotNull($this->domain->getId());
     $this->assertSame($this->domainData['domain'], $this->domain->getDomain());
     $this->assertSame($this->domainData['roadmap']->getId(), $this->domain->getRoadmap()->getId());
     $this->assertSame($this->domainData['description'], $this->domain->getDescription());
     $this->assertSame($this->domainData['color'], $this->domain->getColor());
     $this->assertSame($this->domainData['mainId'], $this->domain->getMainId());
 }
 /**
  * @param $fromUser
  * @param $fromDomain
  * @return bool
  * @throws \SmtpValidatorEmail\Exception\ExceptionNoMailFrom
  */
 public function rcptEachUser($fromUser, $fromDomain)
 {
     $this->transport->getSmtp()->noop();
     // rcpt to for each user
     // var_dump("user list :");
     // var_dump($this->users);
     $iterator = 0;
     $dynamicTimeout = 0;
     if (count($this->users) >= $this->options['sameDomainLimit']) {
         $dynamicTimeout = count($this->users);
     }
     foreach ($this->users as $user) {
         // var_dump("Checking user :"******"Connection lost. Reconnect.");
             $this->establishConnection();
         }
         $address = $user . '@' . $this->dom->getDomain();
         // Sets the results to an integer 0 ( failure ) or 1 ( success )
         $result = $this->transport->getSmtp()->rcpt($address);
         // var_dump("The adress $address, was checked , result: $result");
         $this->statusManager->updateStatus($address, $result);
         if ($iterator == count($this->users)) {
             // stop the loop
             return 1;
         }
         $this->transport->getSmtp()->noop();
         //            if( $iterator > 0 && $iterator % 4 == 0 ){
         //                $this->transport->disconnect();
         //                sleep($dynamicTimeout);
         //            }
         $iterator++;
     }
 }
 /**
  * @param $fromUser
  * @param $fromDomain
  * @return bool
  * @throws \SmtpValidatorEmail\Exception\ExceptionNoMailFrom
  */
 public function rcptEachUser($fromUser, $fromDomain)
 {
     $this->transport->getSmtp()->noop();
     $iterator = 0;
     $dynamicTimeout = 0;
     if (count($this->users) >= $this->options['sameDomainLimit']) {
         $dynamicTimeout = count($this->users);
     }
     foreach ($this->users as $user) {
         if (!$this->transport->getSmtp()->isConnect()) {
             $this->establishConnection();
         }
         $address = $user . '@' . $this->dom->getDomain();
         // Sets the results to an integer 0 ( failure ) or 1 ( success )
         $result = $this->transport->getSmtp()->rcpt($address);
         if ($this->options['detailResults'] === false) {
             $this->statusManager->updateStatus($address, $result);
         }
         if ($iterator == count($this->users)) {
             // stop the loop
             return 1;
         }
         $this->transport->getSmtp()->noop();
         //            if( $iterator > 0 && $iterator % 4 == 0 ){
         //                $this->transport->disconnect();
         //                sleep($dynamicTimeout);
         //            }
         $iterator++;
     }
 }