public function testBundle()
 {
     $bundle = Yii::$app->getAssetManager()->getBundle(DatePickerAsset::className());
     $this->assertInstanceOf('yii\\jui\\datepicker\\DatePickerAsset', $bundle);
     $this->assertArrayHasKey(0, $bundle->depends);
     $this->assertEquals('yii\\jui\\JuiAsset', $bundle->depends[0]);
 }
 /**
  * @param int $mode
  * @param string $actual
  * @param string $expectedHtml
  * @param string $expectedJs
  */
 protected function checkExpected($mode, $actual, $expectedHtml, $expectedJs)
 {
     switch ($mode) {
         case static::MODE_MODEL_ATTRIBUTE:
         case static::MODE_MODEL_ATTRIBUTE_VALUE:
             $expectedHtml = '<div class="form-group field-testform-date">' . "\n" . $expectedHtml . "\n" . '</div>';
         case static::MODE_NAME_VALUE:
             $this->assertEquals($expectedHtml, $actual);
             $view = Yii::$app->getView();
             $this->assertArrayHasKey(DatePickerAsset::className(), $view->assetBundles);
             $this->assertArrayHasKey(DatePickerLanguageAsset::className(), $view->assetBundles);
             $this->assertArrayHasKey(DatePickerLanguageFixAsset::className(), $view->assetBundles);
             $this->assertArrayHasKey(View::POS_READY, $view->js);
             $jsKey = md5($expectedJs);
             $this->assertArrayHasKey($jsKey, $view->js[View::POS_READY]);
             $this->assertEquals($expectedJs, $view->js[View::POS_READY][$jsKey]);
             return;
         case static::MODE_NAME_VALUE_AJAX:
             $expectedHtml .= '<script>' . $expectedJs . '</script>';
             $this->assertEquals($expectedHtml, $actual);
             return;
         case static::MODE_MODEL_ATTRIBUTE_AJAX:
         case static::MODE_MODEL_ATTRIBUTE_VALUE_AJAX:
             $expectedHtml .= '<script>' . $expectedJs . '</script>';
             $expectedHtml = '<div class="form-group field-testform-date">' . "\n" . $expectedHtml . "\n" . '</div>';
             $this->assertEquals($expectedHtml, $actual);
             return;
     }
     throw new Exception();
 }