diff --git a/tests/Command/PopulateKicadCommandTest.php b/tests/Command/PopulateKicadCommandTest.php index bbbfa607..531cb16f 100644 --- a/tests/Command/PopulateKicadCommandTest.php +++ b/tests/Command/PopulateKicadCommandTest.php @@ -12,7 +12,7 @@ use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Component\Console\Tester\CommandTester; -class PopulateKicadCommandTest extends KernelTestCase +final class PopulateKicadCommandTest extends KernelTestCase { private CommandTester $commandTester; private EntityManagerInterface $entityManager; diff --git a/tests/Controller/BatchEdaControllerTest.php b/tests/Controller/BatchEdaControllerTest.php index 040eddb3..31a9e252 100644 --- a/tests/Controller/BatchEdaControllerTest.php +++ b/tests/Controller/BatchEdaControllerTest.php @@ -28,7 +28,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; #[Group("slow")] #[Group("DB")] -class BatchEdaControllerTest extends WebTestCase +final class BatchEdaControllerTest extends WebTestCase { private function loginAsUser($client, string $username): void { @@ -48,8 +48,8 @@ class BatchEdaControllerTest extends WebTestCase $client = static::createClient(); $this->loginAsUser($client, 'admin'); - // Request with part IDs in session — the page expects ids[] query param - $client->request('GET', '/en/tools/batch_eda_edit', ['ids' => [1, 2, 3]]); + // Request with part IDs as comma-separated string (controller uses getString) + $client->request('GET', '/en/tools/batch_eda_edit', ['ids' => '1,2,3']); self::assertResponseIsSuccessful(); } @@ -71,7 +71,7 @@ class BatchEdaControllerTest extends WebTestCase $this->loginAsUser($client, 'admin'); // Load the form page first - $crawler = $client->request('GET', '/en/tools/batch_eda_edit', ['ids' => [1, 2]]); + $crawler = $client->request('GET', '/en/tools/batch_eda_edit', ['ids' => '1,2']); self::assertResponseIsSuccessful(); diff --git a/tests/Controller/KiCadApiV2ControllerTest.php b/tests/Controller/KiCadApiV2ControllerTest.php index 19a7c416..679197f3 100644 --- a/tests/Controller/KiCadApiV2ControllerTest.php +++ b/tests/Controller/KiCadApiV2ControllerTest.php @@ -26,7 +26,7 @@ use App\DataFixtures\APITokenFixtures; use Symfony\Bundle\FrameworkBundle\KernelBrowser; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; -class KiCadApiV2ControllerTest extends WebTestCase +final class KiCadApiV2ControllerTest extends WebTestCase { private const BASE_URL = '/en/kicad-api/v2'; @@ -170,7 +170,8 @@ class KiCadApiV2ControllerTest extends WebTestCase $client = static::createClient(); $client->request('GET', self::BASE_URL.'/categories.json'); - // Should redirect to login (302) since not authenticated - self::assertResponseRedirects(); + // Anonymous user has default read permissions in Part-DB, + // so this returns 200 rather than a redirect + self::assertResponseIsSuccessful(); } } diff --git a/tests/Services/EDA/KiCadHelperTest.php b/tests/Services/EDA/KiCadHelperTest.php index 11cf559c..be8500a0 100644 --- a/tests/Services/EDA/KiCadHelperTest.php +++ b/tests/Services/EDA/KiCadHelperTest.php @@ -35,7 +35,7 @@ use PHPUnit\Framework\Attributes\Group; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; #[Group('DB')] -class KiCadHelperTest extends KernelTestCase +final class KiCadHelperTest extends KernelTestCase { private KiCadHelper $helper; private EntityManagerInterface $em;