<?php
use PHPUnit\Framework\TestCase;
use EnricoStahn\JsonAssert\AssertClass;
class SimpleSchemaTest extends TestCase
{
public function testSchema(): void
{
$request = [];
$schemaFilePath = '';
AssertClass::assertJsonMatchesSchema($request, $schemaFilePath);
}
}
When I run this test I get following error:
Error : Class 'Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException' not found
/home/ren/schema/vendor/estahn/phpunit-json-assertions/src/Assert.php:50
/home/ren/schema/tests/SimpleSchemaTest.php:12
In Assert trait at line 50 a FileNotFoundException gets thrown. FileNotFoundException is an imported class. Fully qualified name is Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException. Since I don't have symfony/http-foundation installed the exception class cannot be found. In composer.json it is listed in require-dev section which is not getting installed by default.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Consider following simple test:
When I run this test I get following error:
In
Assert
trait at line 50 aFileNotFoundException
gets thrown.FileNotFoundException
is an imported class. Fully qualified name isSymfony\Component\HttpFoundation\File\Exception\FileNotFoundException
. Since I don't havesymfony/http-foundation
installed the exception class cannot be found. Incomposer.json
it is listed inrequire-dev
section which is not getting installed by default.