/**
  * Получить данные AMT из вложения
  */
 public function testGetAmtDataFromAttachment()
 {
     $email = new myCreateEmailAmtImport($data = $this->_getData());
     $email->useAttachment();
     $getEmail = new myParseEmailAmtImport((string) $email);
     $this->assertEquals($data, $getEmail->getAmtData());
 }
 /**
  * Успешный вызов
  */
 public function testOk()
 {
     // Подготовить письмо
     $user = $this->helper->makeUser();
     $input = array('id' => $this->helper->makeText('ABC123', false), 'email' => $user->getUserServiceMail(), 'type' => Operation::TYPE_PROFIT, 'account' => $this->helper->makeText('Номер счета', false), 'timestamp' => '2005-08-15T15:52:01+000', 'amount' => '1234.56', 'payment' => '231 234.34 RUR', 'description' => $this->helper->makeText(' Комментарий', false), 'place' => $this->helper->makeText('Место совершения операции', false), 'balance' => '23456.04');
     $date = new DateTime($input['timestamp']);
     $date->setTimezone(new DateTimeZone(date_default_timezone_get()));
     // Письмо
     $email = new myCreateEmailAmtImport($input);
     $email->useAddPart();
     // Импорт
     $this->checkCmd((string) $email, $code = 0);
     // Залезть в БД и проверть операцию
     $expected = array('user_id' => $user->getId(), 'money' => abs((double) $input['amount']), 'date' => $date->format('Y-m-d'), 'type' => Operation::TYPE_PROFIT, 'source_id' => Operation::SOURCE_AMT, 'accepted' => Operation::STATUS_DRAFT);
     $this->assertEquals(1, $this->queryFind('Operation', $expected)->count(), 'Expected found 1 object');
 }