function test_css() { $css = Dataface_CSSTool::getInstance(); $css->addPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'JavascriptToolTest' . DIRECTORY_SEPARATOR . 'css1', '/css1'); $js = new Dataface_JavascriptTool(); $js->clearCache(); $js->addPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'JavascriptToolTest' . DIRECTORY_SEPARATOR . 'js1', '/js1'); $js->addPath(DATAFACE_PATH . '/js', '/dataface/js'); $js->import('scriptE.js'); $actual = trim($js->getContents()); $expected = <<<END if(typeof(window.__xatajax_included__)!='object'){window.__xatajax_included__={};};(function(){var headtg=document.getElementsByTagName("head")[0];if(!headtg)return;var linktg=document.createElement("link");linktg.type="text/css";linktg.rel="stylesheet";linktg.href="http://example.com/site/index.php?-action=css&--id=styleA.css-efd492ea792872aeb8bf19070f7154fa";linktg.title="Styles";headtg.appendChild(linktg);})();if(typeof(window.__xatajax_included__['scriptE.js'])=='undefined'){window.__xatajax_included__['scriptE.js']=true;alert('script E');} END; $expected = trim($expected); $this->assertEquals($expected, $actual); $expected = ''; $actual = $js->getHtml(); $this->assertEquals($expected, $actual); }