| 1 | <?php |
||
| 12 | class SweetAlert2AssetTest extends TestCase |
||
| 13 | {
|
||
| 14 | public function testRegister() |
||
| 15 | {
|
||
| 16 | $min = YII_ENV_DEV ? '' : '.min'; |
||
| 17 | |||
| 18 | $view = $this->getView(); |
||
| 19 | $this->assertEmpty($view->assetBundles); |
||
| 20 | SweetAlert2Asset::register($view); |
||
| 21 | $this->assertEquals(1, count($view->assetBundles)); |
||
| 22 | $this->assertTrue($view->assetBundles['dominus77\\sweetalert2\\assets\\SweetAlert2Asset'] instanceof AssetBundle); |
||
| 23 | $content = $view->renderFile('@tests/views/layouts/rawlayout.php');
|
||
| 24 | $this->assertContains('sweetalert2' . $min . '.css', $content);
|
||
| 25 | $this->assertContains('sweetalert2' . $min . '.js', $content);
|
||
| 26 | } |
||
| 27 | } |