Ejemplo n.º 1
0
 public function testSetPageView()
 {
     $adagnit = new CMService_Adagnit_Client();
     $environment = new CM_Frontend_Environment();
     $js = $adagnit->getJs($environment);
     $this->assertNotContains('ADGN.track.view(', $js);
     $adagnit->addPageView('/foo');
     $js = $adagnit->getJs($environment);
     $this->assertSame(1, substr_count($js, 'ADGN.track.view('));
     $this->assertSame(1, substr_count($js, 'ADGN.track.view("\\/foo");'));
     $adagnit->setPageView('/bar');
     $js = $adagnit->getJs($environment);
     $this->assertSame(1, substr_count($js, 'ADGN.track.view('));
     $this->assertSame(1, substr_count($js, 'ADGN.track.view("\\/bar");'));
 }