Example #1
0
 /**
  * @covers sAdmin::sSaveRegisterNewsletter
  */
 public function testsSaveRegisterNewsletter()
 {
     // Test basic scenario
     $email = uniqid() . '*****@*****.**';
     $result = Shopware()->Db()->fetchOne('SELECT id FROM s_campaigns_mailaddresses WHERE email = ?', array($email));
     $this->assertFalse($result);
     $testData = array('auth' => array('email' => $email));
     $this->module->sSaveRegisterNewsletter($testData);
     $result = Shopware()->Db()->fetchOne('SELECT id FROM s_campaigns_mailaddresses WHERE email = ?', array($email));
     $this->assertGreaterThan(0, $result);
     // Test that duplicates are not changed
     $this->module->sSaveRegisterNewsletter($testData);
     $result = Shopware()->Db()->fetchOne('SELECT id FROM s_campaigns_mailaddresses WHERE email = ?', array($email));
     $this->assertGreaterThan(0, $result);
 }