File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -101,11 +101,11 @@ public function provider_get_escaped_id_list() : array {
101101 *
102102 * @param float|int|string $number the number to format as percentage
103103 * @param string $expected result
104- *
104+ * @param int|bool|null $decimal_points optional, the number of decimal points to use
105105 */
106- public function test_format_percentage ( $ number , string $ expected ) {
106+ public function test_format_percentage ( $ number , string $ expected, $ decimal_points = false ) {
107107
108- $ this ->assertSame ( $ expected , Framework \SV_WC_Helper::format_percentage ( $ number ) );
108+ $ this ->assertSame ( $ expected , Framework \SV_WC_Helper::format_percentage ( $ number, $ decimal_points ) );
109109 }
110110
111111
@@ -121,7 +121,9 @@ public function provider_format_percentage() {
121121 [ '0.5 ' , '50% ' ],
122122 [ 0 , '0% ' ],
123123 [ 1 , '100% ' ],
124- [ 1.333333 , '133.33% ' ],
124+ [ 1.333333 , '133.3333% ' ],
125+ [ 1.333333 , '133.33% ' , 2 ],
126+ [ 1.333333 , '133% ' , null ],
125127 ];
126128 }
127129
You can’t perform that action at this time.
0 commit comments