422 porte sur revenueAmount. */ public function testClientRevenueAmountAuDelaDuPlafondEst422(): void { $client = $this->createAdminClient(); $seed = $this->seedClient('CA Cap Client SARL'); $body = $client->request('PATCH', '/api/clients/'.$seed->getId(), [ 'headers' => ['Content-Type' => self::MERGE], 'json' => ['revenueAmount' => '1000000000000.00'], ])->toArray(false); self::assertResponseStatusCodeSame(422); self::assertArrayHasKey('revenueAmount', $this->violationsByPath($body)); } /** Client : CA exactement au plafond -> accepte (200). */ public function testClientRevenueAmountAuPlafondEst200(): void { $client = $this->createAdminClient(); $seed = $this->seedClient('CA Max Client SARL'); $client->request('PATCH', '/api/clients/'.$seed->getId(), [ 'headers' => ['Content-Type' => self::MERGE], 'json' => ['revenueAmount' => self::MAX], ]); self::assertResponseStatusCodeSame(200); } /** Fournisseur : CA au-dela du plafond -> 422 porte sur revenueAmount. */ public function testSupplierRevenueAmountAuDelaDuPlafondEst422(): void { $client = $this->createAdminClient(); $seed = $this->seedSupplier('CA Cap Fournisseur SARL'); $body = $client->request('PATCH', '/api/suppliers/'.$seed->getId(), [ 'headers' => ['Content-Type' => self::MERGE], 'json' => ['revenueAmount' => '1000000000000.00'], ])->toArray(false); self::assertResponseStatusCodeSame(422); self::assertArrayHasKey('revenueAmount', $this->violationsByPath($body)); } /** Fournisseur : CA exactement au plafond -> accepte (200). */ public function testSupplierRevenueAmountAuPlafondEst200(): void { $client = $this->createAdminClient(); $seed = $this->seedSupplier('CA Max Fournisseur SARL'); $client->request('PATCH', '/api/suppliers/'.$seed->getId(), [ 'headers' => ['Content-Type' => self::MERGE], 'json' => ['revenueAmount' => self::MAX], ]); self::assertResponseStatusCodeSame(200); } }