NelmioApiDocBundle/Tests/Functional/ArrayItemsErrorTest.php

39 lines
1.1 KiB
PHP
Raw Normal View History

<?php
/*
* This file is part of the NelmioApiDocBundle package.
*
* (c) Nelmio
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Nelmio\ApiDocBundle\Tests\Functional;
use Nelmio\ApiDocBundle\Exception\UndocumentedArrayItemsException;
2021-12-11 14:19:43 +01:00
use Symfony\Component\HttpKernel\KernelInterface;
class ArrayItemsErrorTest extends WebTestCase
{
protected function setUp(): void
{
parent::setUp();
static::createClient([], ['HTTP_HOST' => 'api.example.com']);
}
public function testModelPictureDocumentation()
{
$this->expectException(UndocumentedArrayItemsException::class);
$this->expectExceptionMessage('Property "Nelmio\ApiDocBundle\Tests\Functional\Entity\ArrayItemsError\Bar::things[]" is an array, but its items type isn\'t specified.');
2020-12-10 22:28:55 +01:00
$this->getOpenApiDefinition();
}
2021-12-11 14:19:43 +01:00
protected static function createKernel(array $options = []): KernelInterface
{
return new TestKernel(TestKernel::ERROR_ARRAY_ITEMS);
}
}