mirror of
https://github.com/getgrav/grav.git
synced 2026-07-04 09:48:29 +02:00
✅ Test Assets::reset()
This commit is contained in:
@@ -348,4 +348,27 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
$this->assertFalse($assets->exists('another-unexisting-library'));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public function testReset()
|
||||
{
|
||||
$assets = $this->assets();
|
||||
|
||||
$assets->addInlineJs('alert("test")');
|
||||
$assets->reset();
|
||||
$this->assertTrue(count($assets->js()) == 0);
|
||||
|
||||
$assets->addAsyncJs('jquery');
|
||||
$assets->reset();
|
||||
|
||||
$this->assertTrue(count($assets->js()) == 0);
|
||||
|
||||
$assets->addInlineCss('body { color: black }');
|
||||
$assets->reset();
|
||||
|
||||
$this->assertTrue(count($assets->css()) == 0);
|
||||
|
||||
$assets->add('/system/assets/debugger.css', null, true);
|
||||
$assets->reset();
|
||||
|
||||
$this->assertTrue(count($assets->css()) == 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user