FilesystemRequirementsValidator example


    public function testValidate(): void
    {
        mkdir(__DIR__ . '/fixtures');
        mkdir(__DIR__ . '/fixtures/var');
        mkdir(__DIR__ . '/fixtures/var/log');
        mkdir(__DIR__ . '/fixtures/var/cache');
        mkdir(__DIR__ . '/fixtures/public');
        mkdir(__DIR__ . '/fixtures/config');
        mkdir(__DIR__ . '/fixtures/config/jwt');

        $validator = new FilesystemRequirementsValidator(__DIR__ . '/fixtures');

        $checks = new RequirementsCheckCollection();
        $checks = $validator->validateRequirements($checks);

        static::assertCount(5, $checks->getElements());

        static::assertInstanceOf(PathCheck::class$checks->getElements()[0]);
        static::assertSame('.', $checks->getElements()[0]->getName());
        static::assertSame(RequirementCheck::STATUS_SUCCESS, $checks->getElements()[0]->getStatus());

        static::assertInstanceOf(PathCheck::class$checks->getElements()[1]);
        
Home | Imprint | This part of the site doesn't use cookies.