Skip to content

Commit

Permalink
test full CompoundEntity model
Browse files Browse the repository at this point in the history
  • Loading branch information
DjordyKoert committed Jan 9, 2024
1 parent cc7c995 commit 743712f
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions Tests/Functional/FunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -624,17 +624,26 @@ public function testSerializedNameAction()

public function testCompoundEntityAction()
{
$model = $this->getModel('CompoundEntity');
$this->assertCount(1, $model->properties);

$this->assertHasProperty('complex', $model);

$property = $model->properties[0];
$this->assertCount(2, $property->oneOf);

$this->assertSame('integer', $property->oneOf[0]->type);
$this->assertSame('array', $property->oneOf[1]->type);
$this->assertSame('#/components/schemas/CompoundEntity', $property->oneOf[1]->items->ref);
self::assertEquals([
'schema' => 'CompoundEntity',
'type' => 'object',
'required' => ['complex'],
'properties' => [
'complex' => [
'oneOf' => [
[
'type' => 'integer',
],
[
'type' => 'array',
'items' => [
'$ref' => '#/components/schemas/CompoundEntity',
],
],
],
],
],
], json_decode($this->getModel('CompoundEntity')->toJson(), true));
}

public function testInvokableController()
Expand Down

0 comments on commit 743712f

Please sign in to comment.