Skip to content

Commit bc5b93b

Browse files
committed
revert
1 parent c1cf2f7 commit bc5b93b

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

Diff for: tests/behat/bootstrap/BillingContext.php

+7-11
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,14 @@ public function billWithTime($type, $sum, $currency, $quantity, $unit, $target,
231231
'quantity' => "$quantity $unit",
232232
'time' => $time,
233233
]);
234-
Assert::assertSame($type, $bill->getType()->getName(), "Bill type mismatch: expected $type, got {$bill->getType()->getName()}");
235-
Assert::assertSame($target, $bill->getTarget()->getFullName(), "Bill target mismatch: expected $target, got {$bill->getTarget()->getFullName()}");
236-
Assert::assertEquals(bcmul($sum, 100), $bill->getSum()->getAmount(), "Bill sum mismatch: expected $sum, got {$bill->getSum()->getAmount()}");
237-
Assert::assertSame($currency, $bill->getSum()->getCurrency()->getCode(), "Bill currency mismatch: expected $currency, got {$bill->getSum()->getCurrency()->getCode()}");
238-
Assert::assertEquals((float)$quantity, (float)$bill->getQuantity()->getQuantity(), "Bill quantity mismatch: expected $quantity, got {$bill->getQuantity()->getQuantity()}");
239-
Assert::assertEquals(strtolower($unit), strtolower($bill->getQuantity()->getUnit()->getName()), "Bill unit mismatch: expected $unit, got {$bill->getQuantity()->getUnit()->getName()}");
234+
Assert::assertSame($type, $bill->getType()->getName());
235+
Assert::assertSame($target, $bill->getTarget()->getFullName());
236+
Assert::assertEquals(bcmul($sum, 100), $bill->getSum()->getAmount());
237+
Assert::assertSame($currency, $bill->getSum()->getCurrency()->getCode());
238+
Assert::assertEquals((float)$quantity, (float)$bill->getQuantity()->getQuantity());
239+
Assert::assertEquals(strtolower($unit), strtolower($bill->getQuantity()->getUnit()->getName()));
240240
if ($time) {
241-
Assert::assertEquals(new DateTimeImmutable($time), $bill->getTime(), "Bill time mismatch: expected $time, got {$bill->getTime()->format(DATE_ATOM)}");
241+
Assert::assertEquals(new DateTimeImmutable($time), $bill->getTime());
242242
}
243243
}
244244

@@ -337,10 +337,6 @@ protected function prepareTime(string $time = null)
337337
if (strncmp($time, 'pY', 1) === 0) {
338338
return date(substr($time, 1), strtotime('-1 year'));
339339
}
340-
if (str_contains($time, 'pm')) {
341-
$time = str_replace('pm', 'm', $time);
342-
$time = date($time, strtotime('-1 month'));
343-
}
344340
if (strncmp($time, 'Y', 1) === 0) {
345341
return date($time);
346342
}

0 commit comments

Comments
 (0)