@@ -231,14 +231,14 @@ public function billWithTime($type, $sum, $currency, $quantity, $unit, $target,
231
231
'quantity ' => "$ quantity $ unit " ,
232
232
'time ' => $ time ,
233
233
]);
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 ()));
240
240
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 ());
242
242
}
243
243
}
244
244
@@ -337,10 +337,6 @@ protected function prepareTime(string $time = null)
337
337
if (strncmp ($ time , 'pY ' , 1 ) === 0 ) {
338
338
return date (substr ($ time , 1 ), strtotime ('-1 year ' ));
339
339
}
340
- if (str_contains ($ time , 'pm ' )) {
341
- $ time = str_replace ('pm ' , 'm ' , $ time );
342
- $ time = date ($ time , strtotime ('-1 month ' ));
343
- }
344
340
if (strncmp ($ time , 'Y ' , 1 ) === 0 ) {
345
341
return date ($ time );
346
342
}
0 commit comments