Пример #1
0
 /**
  * Test uplne inicializace formulare
  */
 public function testFullMailer()
 {
     $testMailer = new Zend_Mail('cp1250');
     $t = new Application_Model_Form_Contact2(array('mailer' => $testMailer, 'mailerSettings' => array('contactEmail' => '*****@*****.**', 'fromEmail' => '*****@*****.**')));
     /** @var Zend_Mail $mailer */
     $mailer = $t->getMailer();
     $this->assertInstanceOf('Zend_Mail', $mailer);
     $this->assertEquals($testMailer, $mailer);
     $this->assertEquals(array('*****@*****.**'), $mailer->getRecipients());
     $this->assertEquals('*****@*****.**', $mailer->getFrom());
 }
Пример #2
0
 /**
  * Testovaci akce
  */
 public function testAction()
 {
     if (Zend_Registry::get('config')->mtgim->isTest == 1) {
         $contactForm = new Application_Model_Form_Contact2(array('mailerSettings' => Zend_Registry::get('config')->mtgim->toArray()));
         $contactForm->setAction('/index/test');
         $showForm = TRUE;
         // todo tohle udelat doopravdy - isPost neexistuje
         if ($this->_request->isPost()) {
             // zpracuji formular
             $showForm = !$contactForm->process($_POST);
         }
         $this->view->pageId = 'page-test';
         $this->view->showForm = $showForm;
         if ($showForm) {
             $this->view->contactForm = $contactForm;
         }
     } else {
         $this->getHelper('redirector')->goto('index', 'index');
     }
 }