mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-14 14:19:33 +00:00
Merge branch 'master' into bulk-edit-tags
This commit is contained in:
commit
7df3e8e634
421 changed files with 39491 additions and 16789 deletions
|
|
@ -51,8 +51,7 @@ class PartsTableActionHandlerTest extends WebTestCase
|
|||
|
||||
foreach ($formats as $format) {
|
||||
$action = "export_{$format}";
|
||||
$result = $this->service->handleAction($action, $selected_parts, '1', '/test');
|
||||
|
||||
$result = $this->service->handleAction($action, $selected_parts, '1', '/test');
|
||||
$this->assertInstanceOf(RedirectResponse::class, $result);
|
||||
$this->assertStringContainsString('parts/export', $result->getTargetUrl());
|
||||
$this->assertStringContainsString("format={$format}", $result->getTargetUrl());
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Tests\Services\Parts;
|
||||
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Entity\PriceInformations\Orderdetail;
|
||||
use App\Entity\PriceInformations\Pricedetail;
|
||||
|
|
@ -43,7 +44,7 @@ class PricedetailHelperTest extends WebTestCase
|
|||
$this->service = self::getContainer()->get(PricedetailHelper::class);
|
||||
}
|
||||
|
||||
public function maxDiscountAmountDataProvider(): ?\Generator
|
||||
public static function maxDiscountAmountDataProvider(): ?\Generator
|
||||
{
|
||||
$part = new Part();
|
||||
yield [$part, null, 'Part without any orderdetails failed!'];
|
||||
|
|
@ -81,9 +82,7 @@ class PricedetailHelperTest extends WebTestCase
|
|||
yield [$part, 10.0, 'Part with multiple orderdetails failed'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider maxDiscountAmountDataProvider
|
||||
*/
|
||||
#[DataProvider('maxDiscountAmountDataProvider')]
|
||||
public function testGetMaxDiscountAmount(Part $part, ?float $expected_result, string $message): void
|
||||
{
|
||||
$this->assertSame($expected_result, $this->service->getMaxDiscountAmount($part), $message);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue