|
@@ 85-109 (lines=25) @@
|
| 82 |
|
} |
| 83 |
|
|
| 84 |
|
/** @test */ |
| 85 |
|
public function it_should_place_js_asset_after_dependency() |
| 86 |
|
{ |
| 87 |
|
$this->assetManager->addAsset('mega_slider', '/path/to/mega_slider.js'); |
| 88 |
|
$this->assetManager->addAsset('jquery', '/path/to/jquery.js'); |
| 89 |
|
$this->assetManager->addAsset('jquery_plugin', '/path/to/jquery_plugin.js'); |
| 90 |
|
$this->assetManager->addAsset('jquery.iCheck', '/path/to/jquery_iCheck.js'); |
| 91 |
|
$this->assetManager->addAsset('main', '/path/to/main.css'); |
| 92 |
|
$this->assetManager->addAsset('iCheck', '/path/to/iCheck.css'); |
| 93 |
|
$this->assetManager->addAsset('bootstrap', '/path/to/bootstrap.css'); |
| 94 |
|
|
| 95 |
|
$this->assetPipeline->requireJs('jquery'); |
| 96 |
|
$this->assetPipeline->requireJs('mega_slider'); |
| 97 |
|
$this->assetPipeline->requireJs('jquery_plugin')->after('jquery'); |
| 98 |
|
$this->assetPipeline->requireJs('jquery.iCheck'); |
| 99 |
|
|
| 100 |
|
$jsAssets = $this->assetPipeline->allJs(); |
| 101 |
|
|
| 102 |
|
$expected = [ |
| 103 |
|
'jquery' => '/path/to/jquery.js', |
| 104 |
|
'jquery_plugin' => '/path/to/jquery_plugin.js', |
| 105 |
|
'mega_slider' => '/path/to/mega_slider.js', |
| 106 |
|
'jquery.iCheck' => '/path/to/jquery_iCheck.js', |
| 107 |
|
]; |
| 108 |
|
$this->assertEquals($expected, $jsAssets->toArray()); |
| 109 |
|
} |
| 110 |
|
|
| 111 |
|
/** @test */ |
| 112 |
|
public function it_should_place_css_asset_after_dependency() |
|
@@ 112-136 (lines=25) @@
|
| 109 |
|
} |
| 110 |
|
|
| 111 |
|
/** @test */ |
| 112 |
|
public function it_should_place_css_asset_after_dependency() |
| 113 |
|
{ |
| 114 |
|
$this->assetManager->addAsset('mega_slider', '/path/to/mega_slider.js'); |
| 115 |
|
$this->assetManager->addAsset('jquery', '/path/to/jquery.js'); |
| 116 |
|
$this->assetManager->addAsset('jquery_plugin', '/path/to/jquery_plugin.js'); |
| 117 |
|
$this->assetManager->addAsset('main', '/path/to/main.css'); |
| 118 |
|
$this->assetManager->addAsset('iCheck', '/path/to/iCheck.css'); |
| 119 |
|
$this->assetManager->addAsset('bootstrap', '/path/to/bootstrap.css'); |
| 120 |
|
$this->assetManager->addAsset('datatables-css', '/path/to/datatables.css'); |
| 121 |
|
|
| 122 |
|
$this->assetPipeline->requireCss('bootstrap'); |
| 123 |
|
$this->assetPipeline->requireCss('iCheck'); |
| 124 |
|
$this->assetPipeline->requireCss('main')->after('bootstrap'); |
| 125 |
|
$this->assetPipeline->requireCss('datatables-css'); |
| 126 |
|
|
| 127 |
|
$cssAssets = $this->assetPipeline->allCss(); |
| 128 |
|
|
| 129 |
|
$expected = [ |
| 130 |
|
'bootstrap' => '/path/to/bootstrap.css', |
| 131 |
|
'main' => '/path/to/main.css', |
| 132 |
|
'iCheck' => '/path/to/iCheck.css', |
| 133 |
|
'datatables-css' => '/path/to/datatables.css', |
| 134 |
|
]; |
| 135 |
|
$this->assertEquals($expected, $cssAssets->toArray()); |
| 136 |
|
} |
| 137 |
|
|
| 138 |
|
/** @test */ |
| 139 |
|
public function it_should_place_js_asset_before_dependency() |
|
@@ 139-163 (lines=25) @@
|
| 136 |
|
} |
| 137 |
|
|
| 138 |
|
/** @test */ |
| 139 |
|
public function it_should_place_js_asset_before_dependency() |
| 140 |
|
{ |
| 141 |
|
$this->assetManager->addAsset('mega_slider', '/path/to/mega_slider.js'); |
| 142 |
|
$this->assetManager->addAsset('jquery', '/path/to/jquery.js'); |
| 143 |
|
$this->assetManager->addAsset('jquery_plugin', '/path/to/jquery_plugin.js'); |
| 144 |
|
$this->assetManager->addAsset('jquery.iCheck', '/path/to/jquery_iCheck.js'); |
| 145 |
|
$this->assetManager->addAsset('main', '/path/to/main.css'); |
| 146 |
|
$this->assetManager->addAsset('iCheck', '/path/to/iCheck.css'); |
| 147 |
|
$this->assetManager->addAsset('bootstrap', '/path/to/bootstrap.css'); |
| 148 |
|
|
| 149 |
|
$this->assetPipeline->requireJs('jquery'); |
| 150 |
|
$this->assetPipeline->requireJs('mega_slider'); |
| 151 |
|
$this->assetPipeline->requireJs('jquery_plugin')->before('mega_slider'); |
| 152 |
|
$this->assetPipeline->requireJs('jquery.iCheck'); |
| 153 |
|
|
| 154 |
|
$jsAssets = $this->assetPipeline->allJs(); |
| 155 |
|
|
| 156 |
|
$expected = [ |
| 157 |
|
'jquery' => '/path/to/jquery.js', |
| 158 |
|
'mega_slider' => '/path/to/mega_slider.js', |
| 159 |
|
'jquery_plugin' => '/path/to/jquery_plugin.js', |
| 160 |
|
'jquery.iCheck' => '/path/to/jquery_iCheck.js', |
| 161 |
|
]; |
| 162 |
|
$this->assertEquals($expected, $jsAssets->toArray()); |
| 163 |
|
} |
| 164 |
|
|
| 165 |
|
/** @test */ |
| 166 |
|
public function it_should_place_css_asset_before_dependency() |
|
@@ 166-190 (lines=25) @@
|
| 163 |
|
} |
| 164 |
|
|
| 165 |
|
/** @test */ |
| 166 |
|
public function it_should_place_css_asset_before_dependency() |
| 167 |
|
{ |
| 168 |
|
$this->assetManager->addAsset('mega_slider', '/path/to/mega_slider.js'); |
| 169 |
|
$this->assetManager->addAsset('jquery', '/path/to/jquery.js'); |
| 170 |
|
$this->assetManager->addAsset('jquery_plugin', '/path/to/jquery_plugin.js'); |
| 171 |
|
$this->assetManager->addAsset('main', '/path/to/main.css'); |
| 172 |
|
$this->assetManager->addAsset('iCheck', '/path/to/iCheck.css'); |
| 173 |
|
$this->assetManager->addAsset('bootstrap', '/path/to/bootstrap.css'); |
| 174 |
|
$this->assetManager->addAsset('datatables-css', '/path/to/datatables.css'); |
| 175 |
|
|
| 176 |
|
$this->assetPipeline->requireCss('bootstrap'); |
| 177 |
|
$this->assetPipeline->requireCss('iCheck'); |
| 178 |
|
$this->assetPipeline->requireCss('main')->before('iCheck'); |
| 179 |
|
$this->assetPipeline->requireCss('datatables-css'); |
| 180 |
|
|
| 181 |
|
$cssAssets = $this->assetPipeline->allCss(); |
| 182 |
|
|
| 183 |
|
$expected = [ |
| 184 |
|
'bootstrap' => '/path/to/bootstrap.css', |
| 185 |
|
'main' => '/path/to/main.css', |
| 186 |
|
'iCheck' => '/path/to/iCheck.css', |
| 187 |
|
'datatables-css' => '/path/to/datatables.css', |
| 188 |
|
]; |
| 189 |
|
$this->assertEquals($expected, $cssAssets->toArray()); |
| 190 |
|
} |
| 191 |
|
|
| 192 |
|
/** @test */ |
| 193 |
|
public function it_should_require_an_array_of_assets() |