SiretTest.php 927 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace App\Tests\Application\Utils;
  3. use App\Tests\Application\OtWebTestCase;
  4. class SiretTest extends OtWebTestCase
  5. {
  6. public function testSiretResource(): void
  7. {
  8. $this->logger->info("\033[1;34mStarting test... Siret check\033[0m");
  9. $this->loginAs($this->user);
  10. $this->get('/api/siret-checking/34919841600035');
  11. $this->logger->info("\033[1;34mRequest made to /api/siret-checking/34919841600035\033[0m");
  12. $this->assertResponseStatusCodeSame(200);
  13. $this->logger->info("\033[1;34mReceived status code 200\033[0m");
  14. $this->assertJsonContains([
  15. '@context' => '/api/contexts/Siret',
  16. '@id' => '/api/siret-checking/34919841600035',
  17. '@type' => 'Siret',
  18. 'number' => '34919841600035',
  19. 'isCorrect' => true,
  20. ]);
  21. $this->logger->info("\033[1;32mTest 'Siret check' succeeded\033[0m");
  22. }
  23. }