Index: tests/Zend/View/Helper/HeadScriptTest.php =================================================================== --- tests/Zend/View/Helper/HeadScriptTest.php (revision 24956) +++ tests/Zend/View/Helper/HeadScriptTest.php (working copy) @@ -465,6 +465,50 @@ $test = $this->helper->toString(); $this->assertEquals($expected, $test); } + + public function testConditionalWithAllowArbitraryAttributesDoesNotIncludeConditionalScript() + { + $this->helper->setAllowArbitraryAttributes(true); + $this->helper->appendFile( + '/js/foo.js', 'text/javascript', array('conditional' => 'lt IE 7') + ); + $test = $this->helper->toString(); + + $this->assertNotContains('conditional', $test); + } + + public function testNoEscapeWithAllowArbitraryAttributesDoesNotIncludeNoEscapeScript() + { + $this->helper->setAllowArbitraryAttributes(true); + $this->helper->appendScript( + '// some script', 'text/javascript', array('noescape' => true) + ); + $test = $this->helper->toString(); + + $this->assertNotContains('noescape', $test); + } + + public function testNoEscapeDefaultsToFalse() + { + $this->helper->appendScript( + '// some script' . PHP_EOL, 'text/javascript', array() + ); + $test = $this->helper->toString(); + + $this->assertContains('//', $test); + } + + public function testNoEscapeTrue() + { + $this->helper->appendScript( + '// some script' . PHP_EOL, 'text/javascript', array('noescape' => true) + ); + $test = $this->helper->toString(); + + $this->assertNotContains('//', $test); + } } // Call Zend_View_Helper_HeadScriptTest::main() if this source file is executed directly.