Exemplo n.º 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());
 }
Exemplo n.º 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());
 }