2020-11-20 17:06:56 +01:00
< ? 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 ;
2020-11-20 17:06:56 +01:00
class ArrayItemsErrorTest extends WebTestCase
{
2020-12-10 21:59:36 +01:00
protected function setUp () : void
2020-11-20 17:06:56 +01:00
{
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 ();
2020-11-20 17:06:56 +01:00
}
2021-12-11 14:19:43 +01:00
protected static function createKernel ( array $options = []) : KernelInterface
2020-11-20 17:06:56 +01:00
{
return new TestKernel ( TestKernel :: ERROR_ARRAY_ITEMS );
}
}