Beispiel #1
0
 /**
  * @depends testUpdate
  * @param NewsletterModel $newsletter
  */
 public function testUnsubscribe(NewsletterModel $newsletter)
 {
     $event = new NewsletterEvent('*****@*****.**', 'en_US');
     $event->setId($newsletter->getId());
     $action = new Newsletter();
     $action->unsubscribe($event);
     $deletedNewsletter = $event->getNewsletter();
     $this->assertInstanceOf('Thelia\\Model\\Newsletter', $deletedNewsletter);
     $this->assertEquals(1, NewsletterQuery::create()->filterByEmail('*****@*****.**')->filterByUnsubscribed(true)->count());
 }
Beispiel #2
0
 /**
  * @depends testUpdate
  */
 public function testUnsubscribe(NewsletterModel $newsletter)
 {
     $event = new NewsletterEvent('*****@*****.**', 'en_US');
     $event->setId($newsletter->getId());
     $action = new Newsletter();
     $action->unsubscribe($event);
     $deletedNewsletter = $event->getNewsletter();
     $this->assertInstanceOf('Thelia\\Model\\Newsletter', $deletedNewsletter);
     $this->assertTrue($deletedNewsletter->isDeleted());
 }
Beispiel #3
0
 /**
  * Exclude object from result
  *
  * @param   ChildNewsletter $newsletter Object to remove from the list of results
  *
  * @return ChildNewsletterQuery The current query, for fluid interface
  */
 public function prune($newsletter = null)
 {
     if ($newsletter) {
         $this->addUsingAlias(NewsletterTableMap::ID, $newsletter->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }