Skip to content

Commit

Permalink
test and cdn update
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed May 6, 2020
1 parent 3a199f4 commit b018e21
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Bootstrap4Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
class Bootstrap4Asset extends \yii\web\AssetBundle
{
public $js = [
['//stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js', 'integrity' => 'sha384-xrRywqdh3PHs8keKZN+8zzc5TX0GRTLCcmivcbNJWm2rs5C8PRhcEn3czEjhAO9o', 'crossorigin' => 'anonymous'],
['//stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.bundle.min.js', 'integrity' => 'sha384-6khuMg9gaYr5AxOqhkVIODVIvm9ynTT5J4V1cfthmT+emCG6yVmEZsRHdxlotUnm', 'crossorigin' => 'anonymous'],
];

public $css = [
['//stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css', 'integrity' => 'sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T', 'crossorigin' => 'anonymous'],
['//stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css', 'integrity' => 'sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh', 'crossorigin' => 'anonymous'],
];


Expand Down
18 changes: 18 additions & 0 deletions tests/src/ActiveFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,24 @@ public function testActiveFormLayout()
</div>
</div>', ob_get_clean());
}

/**
* @runInSeparateProcess
*/
public function testCheckboxSwitch()
{
Yii::setAlias('@webroot', dirname(__DIR__));
$model = new StubModel();
ob_start();
ob_implicit_flush(false);

$form = ActiveForm::begin(['layout' => 'horizontal']);
echo $form->field($model, 'firstname')->checkboxSwitch();
ActiveForm::end();

$this->assertContainsTrimmed('
<div class="form-group row field-stubmodel-firstname"><div class="col-sm-10"><div class="custom-control custom-switch"><input type="hidden" name="StubModel[firstname]" value="0"><input type="checkbox" id="stubmodel-firstname" class="custom-control-input" name="StubModel[firstname]" value="1"><label class="custom-control-label" for="stubmodel-firstname"><label for="stubmodel-firstname">Firstname</label></label></div><div class="invalid-feedback"></div></div></div></form>', ob_get_clean());
}

/**
* @runInSeparateProcess
Expand Down

0 comments on commit b018e21

Please sign in to comment.