public function testCreateImapServicesForOtherServices()
 {
     $config = array('' => array('Oro\\Bundle\\ImapBundle\\Tests\\Unit\\Connector\\TestFixtures\\Imap2', 'Oro\\Bundle\\ImapBundle\\Tests\\Unit\\Connector\\TestFixtures\\SearchStringManager2'), 'FEATURE2' => array('Oro\\Bundle\\ImapBundle\\Tests\\Unit\\Connector\\TestFixtures\\Imap1', 'Oro\\Bundle\\ImapBundle\\Tests\\Unit\\Connector\\TestFixtures\\SearchStringManager1'));
     $factory = new ImapServicesFactory($config);
     $services = $factory->createImapServices(new ImapConfig());
     $expected = new ImapServices(new TestFixtures\Imap1(array()), new TestFixtures\SearchStringManager1());
     $this->assertEquals($expected, $services);
 }
Example #2
0
 /**
  * Makes sure that there is active connection to IMAP server
  */
 protected function ensureConnected()
 {
     if ($this->imap === null) {
         $imapServices = $this->factory->createImapServices($this->config);
         $this->imap = $imapServices->getStorage();
         $this->searchStringManager = $imapServices->getSearchStringManager();
     }
 }