public function import()
 {
     $imap = new Server($this->server, $this->port);
     $imap->setAuthentication($this->username, $this->password);
     $imap->setMailBox($this->mailbox);
     $dataProvider = new DataProvider();
     $purchaseService = new PurchaseService($dataProvider);
     $user_service = new UserService($dataProvider, new Client());
     $user = $user_service->getById($this->backend_users_id);
     $importer = new ImporterService();
     $importer->addImporter(new MailItauCardImport($imap, $purchaseService));
     $importer->addImporter(new MailItauDebitImport($imap, $purchaseService));
     $importer->addImporter(new MailItauWithdrawImport($imap, $purchaseService));
     $importer->addImporter(new MailItauUniclassDebitImport($imap, $purchaseService));
     if ($this->is_first_time) {
         $importer->import(null, $user);
         $this->is_first_time = false;
         $this->save();
     } else {
         $importer->import(10, $user);
     }
 }
Ejemplo n.º 2
0
 public function testDelete_Invalid()
 {
     $this->assertFalse($this->user_service->delete(0));
 }