| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace App\Tests\Application\Enum;
- use App\Tests\Application\OtWebTestCase;
- use Symfony\Component\HttpFoundation\Response;
- class EnumTest extends OtWebTestCase
- {
- public function testGetEnumSuccess()
- {
- $this->loginAs($this->user);
- $this->assertResponseIsSuccessful();
- $enumName = 'function';
- $this->get("/api/enum/$enumName");
- $this->assertResponseStatusCodeSame(Response::HTTP_OK);
- $this->assertResponseIsSuccessful();
- }
- public function testGetEnumNotFound()
- {
- $this->loginAs($this->user);
- $this->assertResponseIsSuccessful();
- $enumName = 'notfound';
- $this->get("/api/enum/$enumName");
- $this->assertResponseStatusCodeSame(Response::HTTP_NOT_FOUND);
- }
- public function testGetCategoryEnum()
- {
- $this->loginAs($this->user);
- $this->assertResponseIsSuccessful();
- $this->get('/api/enum/organization_category');
- $this->assertResponseStatusCodeSame(Response::HTTP_OK);
- $this->assertResponseIsSuccessful();
- $this->assertJsonContains([
- '@context' => '/api/contexts/Enum',
- '@id' => '/api/enum/organization_category',
- '@type' => 'Enum',
- 'name' => 'organization_category',
- 'items' => [
- "PROFESSIONAL" => "PROFESSIONAL",
- "ARTISTIC_ENSEMBLE" => "ARTISTIC_ENSEMBLE",
- "SCHOOL_OF_ARTS" => "SCHOOL_OF_ARTS",
- "NETWORK" => "NETWORK",
- "ORGANIZER" => "ORGANIZER",
- "PERSON" => "PERSON",
- "OTHER" => "OTHER"
- ]
- ]);
- }
- }
|