mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-24 03:49:31 +00:00
Migrated phpunit annotations to attributes
This commit is contained in:
parent
f1d34bbc24
commit
dc480f755c
50 changed files with 171 additions and 246 deletions
|
|
@ -41,6 +41,8 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Tests\Services\LabelSystem\BarcodeScanner;
|
||||
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use App\Entity\LabelSystem\LabelSupportedElement;
|
||||
use App\Services\LabelSystem\BarcodeScanner\BarcodeRedirector;
|
||||
use App\Services\LabelSystem\BarcodeScanner\BarcodeSourceType;
|
||||
|
|
@ -66,10 +68,8 @@ final class BarcodeRedirectorTest extends KernelTestCase
|
|||
yield [new LocalBarcodeScanResult(LabelSupportedElement::STORELOCATION, 1, BarcodeSourceType::INTERNAL), '/en/store_location/1/parts'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider urlDataProvider
|
||||
* @group DB
|
||||
*/
|
||||
#[DataProvider('urlDataProvider')]
|
||||
#[Group('DB')]
|
||||
public function testGetRedirectURL(LocalBarcodeScanResult $scanResult, string $url): void
|
||||
{
|
||||
$this->assertSame($url, $this->service->getRedirectURL($scanResult));
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Tests\Services\LabelSystem\BarcodeScanner;
|
||||
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use App\Entity\LabelSystem\LabelSupportedElement;
|
||||
use App\Services\LabelSystem\BarcodeScanner\BarcodeScanHelper;
|
||||
use App\Services\LabelSystem\BarcodeScanner\BarcodeScanResultInterface;
|
||||
|
|
@ -140,17 +141,13 @@ class BarcodeScanHelperTest extends WebTestCase
|
|||
yield [''];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider dataProvider
|
||||
*/
|
||||
#[DataProvider('dataProvider')]
|
||||
public function testNormalizeBarcodeContent(BarcodeScanResultInterface $expected, string $input): void
|
||||
{
|
||||
$this->assertEquals($expected, $this->service->scanBarcodeContent($input));
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider invalidDataProvider
|
||||
*/
|
||||
#[DataProvider('invalidDataProvider')]
|
||||
public function testInvalidFormats(string $input): void
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue