mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-08 01:14:34 +02:00
Improved code style of tests
This commit is contained in:
parent
5629215ce4
commit
684334ba22
73 changed files with 196 additions and 38 deletions
|
@ -8,6 +8,9 @@ use App\Entity\Parts\PartLot;
|
|||
use App\Services\LogSystem\EventCommentHelper;
|
||||
use App\Services\LogSystem\EventLogger;
|
||||
|
||||
/**
|
||||
* @see \App\Tests\Services\Parts\PartLotWithdrawAddHelperTest
|
||||
*/
|
||||
final class PartLotWithdrawAddHelper
|
||||
{
|
||||
public function __construct(private readonly EventLogger $eventLogger, private readonly EventCommentHelper $eventCommentHelper)
|
||||
|
|
|
@ -32,6 +32,9 @@ use Locale;
|
|||
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* @see \App\Tests\Services\Parts\PricedetailHelperTest
|
||||
*/
|
||||
class PricedetailHelper
|
||||
{
|
||||
protected string $locale;
|
||||
|
@ -54,7 +57,7 @@ class PricedetailHelper
|
|||
foreach ($orderdetails as $orderdetail) {
|
||||
$pricedetails = $orderdetail->getPricedetails();
|
||||
//The orderdetail must have pricedetails, otherwise this will not work!
|
||||
if (0 === count($pricedetails)) {
|
||||
if (0 === (is_countable($pricedetails) ? count($pricedetails) : 0)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -99,7 +102,7 @@ class PricedetailHelper
|
|||
foreach ($orderdetails as $orderdetail) {
|
||||
$pricedetails = $orderdetail->getPricedetails();
|
||||
//The orderdetail must have pricedetails, otherwise this will not work!
|
||||
if (0 === count($pricedetails)) {
|
||||
if (0 === (is_countable($pricedetails) ? count($pricedetails) : 0)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue