ResidenceAreaTest.php 973 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Tests\Application;
  3. use App\Entity\Billing\ResidenceArea;
  4. use App\Tests\Application\OtWebTestCase;
  5. class ResidenceAreaTest extends OtWebTestCase
  6. {
  7. public function testGetResidenceAreas(): void
  8. {
  9. $this->loginAs($this->user);
  10. // $this->client->request('GET', '/api/residence_areas');
  11. // $this->assertResponseIsSuccessful();
  12. // $this->assertMatchesResourceCollectionJsonSchema(ResidenceArea::class);
  13. if($this->user->getPerson()) {
  14. $this->get('/api/residence_areas');
  15. $this->validateCollectionSchema(ResidenceArea::class);
  16. $this->assertJsonContains([
  17. '@context' => '/api/contexts/ResidenceArea',
  18. '@id' => '/api/residence_areas',
  19. '@type' => 'hydra:Collection',
  20. 'hydra:totalItems' => 1,
  21. 'hydra:member' => [
  22. ["label" => "My Residence Area"]
  23. ],
  24. ]);
  25. }
  26. }
  27. }