1 | <?php |
||
15 | class JsonEditorTest extends TestCase |
||
16 | { |
||
17 | public static function assetProvider() |
||
23 | |||
24 | /** |
||
25 | * @param string $css |
||
26 | * @param string $minimalistJs |
||
27 | * @param string $fullJs |
||
28 | * @covers \kdn\yii2\assets\JsonEditorAsset |
||
29 | * @covers \kdn\yii2\JsonEditor |
||
30 | * @dataProvider assetProvider |
||
31 | * @medium |
||
32 | */ |
||
33 | public function testAsset($css, $minimalistJs, $fullJs) |
||
52 | |||
53 | public static function assetDevelopmentProvider() |
||
54 | { |
||
55 | return [ |
||
56 | 'development' => ['jsoneditor.css', 'jsoneditor-minimalist.js', 'jsoneditor.js'], |
||
57 | ]; |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * @param string $css |
||
62 | * @param string $minimalistJs |
||
63 | * @param string $fullJs |
||
64 | * @covers \kdn\yii2\assets\JsonEditorAsset |
||
65 | * @covers \kdn\yii2\JsonEditor |
||
66 | * @dataProvider assetDevelopmentProvider |
||
67 | * @medium |
||
68 | */ |
||
69 | public function testAssetDevelopment($css, $minimalistJs, $fullJs) |
||
70 | { |
||
71 | if (!function_exists('runkit_constant_redefine')) { |
||
72 | $this->markTestSkipped('runkit extension required.'); |
||
73 | return; |
||
74 | } |
||
75 | |||
76 | $yiiEnvDev = YII_ENV_DEV; |
||
77 | runkit_constant_redefine('YII_ENV_DEV', true); |
||
78 | $this->testAsset($css, $minimalistJs, $fullJs); |
||
79 | runkit_constant_redefine('YII_ENV_DEV', $yiiEnvDev); |
||
80 | } |
||
81 | |||
82 | /** |
||
83 | * @covers \kdn\yii2\JsonEditor |
||
84 | * @uses \kdn\yii2\assets\JsonEditorAsset |
||
85 | * @medium |
||
86 | */ |
||
87 | public function testEditorWidget() |
||
109 | |||
110 | /** |
||
111 | * @covers \kdn\yii2\JsonEditor |
||
112 | * @uses \kdn\yii2\assets\JsonEditorAsset |
||
113 | * @medium |
||
114 | */ |
||
115 | public function testEditorWidgetWithScriptInJson() |
||
128 | |||
129 | /** |
||
130 | * @covers \kdn\yii2\JsonEditor |
||
131 | * @uses \kdn\yii2\assets\JsonEditorAsset |
||
132 | * @medium |
||
133 | */ |
||
134 | public function testEditorActiveWidgetAndDefaults() |
||
147 | |||
148 | /** |
||
149 | * @covers \kdn\yii2\JsonEditor |
||
150 | * @uses \kdn\yii2\assets\JsonEditorAsset |
||
151 | * @medium |
||
152 | */ |
||
153 | public function testEditorActiveWidgetWithAttributeExpression() |
||
168 | } |
||
169 |