コード例 #1
0
 /**
  * @group ZF-12287
  */
 public function testNoEscapeTrue()
 {
     $this->helper->appendScript('// some script' . PHP_EOL, 'text/javascript', array('noescape' => true));
     $test = $this->helper->toString();
     $this->assertNotContains('//<!--', $test);
     $this->assertNotContains('//-->', $test);
 }
コード例 #2
0
ファイル: HeadScriptTest.php プロジェクト: lortnus/zf1
    public function testIndentationIsHonored()
    {
        $this->helper->setIndent(4);
        $this->helper->appendScript('
var foo = "bar";
document.write(foo.strlen());');
        $this->helper->appendScript('
var bar = "baz";
document.write(bar.strlen());');
        $string = $this->helper->toString();
        $scripts = substr_count($string, '    <script');
        $this->assertEquals(2, $scripts);
        $this->assertContains('    //', $string);
        $this->assertContains('    var', $string);
        $this->assertContains('    document', $string);
    }