Skip to content

Commit

Permalink
adds coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
cnizzardini committed May 15, 2024
1 parent c3a4c2e commit 956af81
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tests/TestCase/Lib/OpenApi/SchemaPropertyTest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php
declare(strict_types=1);

namespace SwaggerBake\Test\TestCase\Lib\OpenApi;

use Cake\TestSuite\TestCase;
use SwaggerBake\Lib\OpenApi\Schema;
use InvalidArgumentException;
use SwaggerBake\Lib\OpenApi\SchemaProperty;

class SchemaPropertyTest extends TestCase
Expand All @@ -21,7 +22,13 @@ public function test_example_is_json_encoded_when_blank(): void

public function test_invalid_type_throws_exception(): void
{
$this->expectException(\InvalidArgumentException::class);
$this->expectException(InvalidArgumentException::class);
new SchemaProperty('test', 'invalid');
}
}

public function test_enum_properties_is_indexed_numerically(): void
{
$vars = (new SchemaProperty())->setEnum(['test' => 'test'])->toArray();
$this->assertArrayHasKey(0, $vars['enum']);
}
}

0 comments on commit 956af81

Please sign in to comment.