estahn / phpunit-json-assertions

JSON assertions for PHPUnit (including JSON Schema)
MIT License
37 stars 10 forks source link

FileNotFoundException does not exist #22

Closed ragol closed 5 years ago

ragol commented 5 years ago

Consider following simple test:

<?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.

stale[bot] commented 5 years ago

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.