public function testAddScript() { $this->res->addScript('alert("hi");', 0, 'testAddScript')->addScript('alert("there");', 0, 'testAddScript'); $smarty = CRM_Core_Smarty::singleton(); $actual = $smarty->fetch('string:{crmRegion name=testAddScript}{/crmRegion}'); $expected = "" . "<script type=\"text/javascript\">\nalert(\"hi\");\n</script>\n" . "<script type=\"text/javascript\">\nalert(\"there\");\n</script>\n"; $this->assertEquals($expected, $actual); }