@@ -7,9 +7,9 @@ class HelpersTest {
77 private $ helpers = [...new Helpers ()->helpers ()];
88
99 #[Test, Values([
10- [['2022-11-29 ' , '2022-12-01 ' , 'format ' => 'd.m.Y ' ], '29.11.2022 - 01.12.2022 ' ],
10+ [['2022-11-29 ' , '2022-12-01 ' , 'format ' => 'd.m.Y ' ], '29.11.2022 — 01.12.2022 ' ],
1111 [['2022-11-29 ' , '2022-11-29 ' , 'format ' => 'd.m.Y ' ], '29.11.2022 ' ],
12- [['2022-11-29 ' , '2022-12-01 ' , 'format ' => 'M Y ' ], 'Nov 2022 - Dec 2022 ' ],
12+ [['2022-11-29 ' , '2022-12-01 ' , 'format ' => 'M Y ' ], 'Nov 2022 — Dec 2022 ' ],
1313 [['2022-11-29 ' , '2022-11-30 ' , 'format ' => 'M Y ' ], 'Nov 2022 ' ],
1414 ])]
1515 public function range ($ options , $ expected ) {
@@ -27,6 +27,17 @@ public function range_rel($options, $expected) {
2727 Assert::equals ($ expected , $ this ->helpers ['range-rel ' ](null , null , $ options ));
2828 }
2929
30+ #[Test, Values([
31+ [[25.0 , 25.0 ], '25.0 ' ],
32+ [[25.0 , 25.4 ], '25.2 ' ],
33+ [[25.2 , 25.4 , 'tolerance ' => 0 ], '25.2 — 25.4 ' ],
34+ [[25.4 , 27.2 ], '25.4 — 27.2 ' ],
35+ [[-1.5 , 1.5 ], '-1.5 — 1.5 ' ],
36+ ])]
37+ public function temperature ($ options , $ expected ) {
38+ Assert::equals ($ expected , $ this ->helpers ['temperature ' ](null , null , $ options ));
39+ }
40+
3041 #[Test, Values([
3142 [['slug ' => 'test ' , 'is ' => ['journey ' => true ]], 'journey/test ' ],
3243 [['slug ' => 'test ' , 'is ' => ['content ' => true ]], 'content/test ' ],
0 commit comments