Additional path and extension tests for JavascriptHelper::link()

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6434 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2008-02-04 17:12:19 +00:00
parent 241bda262a
commit abd94bc068

View file

@ -84,6 +84,18 @@ class JavascriptTest extends UnitTestCase {
$result = $this->Javascript->link('/plugin/js/jquery-1.1.2');
$expected = '<script type="text/javascript" src="/plugin/js/jquery-1.1.2.js"></script>';
$this->assertEqual($result, $expected);
$result = $this->Javascript->link('/some_other_path/myfile.1.2.2.min.js');
$expected = '<script type="text/javascript" src="/some_other_path/myfile.1.2.2.min.js"></script>';
$this->assertEqual($result, $expected);
$result = $this->Javascript->link('some_other_path/myfile.1.2.2.min.js');
$expected = '<script type="text/javascript" src="js/some_other_path/myfile.1.2.2.min.js"></script>';
$this->assertEqual($result, $expected);
$result = $this->Javascript->link('some_other_path/myfile.1.2.2.min');
$expected = '<script type="text/javascript" src="js/some_other_path/myfile.1.2.2.min.js"></script>';
$this->assertEqual($result, $expected);
}
function testObjectGeneration() {