1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-11 17:14:42 +02:00

addJs() method cleanup. Work-in-progress.

This commit is contained in:
Cameron
2021-10-11 19:06:03 -07:00
parent 7755dd1743
commit 0442ba138a
2 changed files with 95 additions and 19 deletions

View File

@@ -166,12 +166,44 @@
{
}
*/
public function testHeaderFile()
{
$load = array(
0 => array(
'file' => '{e_PLUGIN}forum/js/forum.js',
'zone' => 5,
),
1 => array(
'file' => 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js',
'zone' => 1,
),
2 => array(
'file' => '{e_WEB}js/bootstrap-notify/js/bootstrap-notify.js',
'zone' => 2
),
);
foreach($load as $t)
{
$this->js->headerFile($t['file'], $t['zone']);
}
$result = $this->js->renderJs('header', 1, true, true);
$expected = '
<!-- [JSManager] Header JS include - zone #1 -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
';
$this->assertSame($expected, $result);
}
/*
public function testSetDependency()
{