Beispiel #1
0
 public function testCampaignInactivation()
 {
     $c = Factory::cc(false);
     $this->assertFalse($c->isActive());
     $c->activate();
     $this->assertTrue($c->isActive());
 }
 public function testJsVariablesAreOk()
 {
     $c = Factory::cci(10, 100, 27);
     $generator = new FancyboxAjaxGenerator('http://test.lcl/testpopup.php');
     $js = $generator->getScript($c, 54);
     $this->assertContains('var ' . DataResolver::CAMPAIGN_ID_KEY . ' = "27"', $js);
     $this->assertContains('var url = "http://test.lcl/testpopup.php"', $js);
     $this->assertContains('var tout = 54000', $js);
 }
Beispiel #3
0
 public function testImpressionsCannotBeIncreasedTodayIfHasNoRemainingImpressionsForToday()
 {
     $impressions = Factory::cici(3, 10, 3, 3);
     $this->assertFalse($impressions->canBeIncreasedToday());
 }
 public function testMultipleCampaignsDataAreOk()
 {
     $i1 = Factory::cici(3, 10, 2, 8, 555);
     $i2 = Factory::cici(2, 8, 1, 3, 556);
     $this->save($i1);
     $this->save($i2);
     $impressions1 = $this->findByCampaign($i1->getCampaign());
     $impressions2 = $this->findByCampaign($i2->getCampaign());
     $this->assertEquals(2, $impressions1->getForToday());
     $this->assertEquals(8, $impressions1->getTotal());
     $this->assertEquals(555, $impressions1->getCampaignTrackingId());
     $this->assertEquals(1, $impressions2->getForToday());
     $this->assertEquals(3, $impressions2->getTotal());
     $this->assertEquals(556, $impressions2->getCampaignTrackingId());
 }