Test Assets::reset()

This commit is contained in:
Flavio Copes
2016-01-27 10:25:53 +01:00
parent 60876f2f09
commit 2a06cfc5e2

View File

@@ -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);
}