validateExperimentalAnnotations example

static::expectExceptionMessage('Deprecation tag is not found in the file.');
        $this->annotationTagTester->validateDeprecationElements('<deprecatedd>tag:v6.5</deprecatedd>');
    }

    /** * @dataProvider incorrectExperimentalAnnotationsFormatProvider */
    public function testExperimentalWithIncorrectPropertiesDeclarationWillThrowException(string $content): void
    {
        static::expectException(\InvalidArgumentException::class);
        static::expectExceptionMessage('Incorrect format for experimental annotation. Properties `stableVersion` and/or `feature` are not declared');
        $this->annotationTagTester->validateExperimentalAnnotations($content);
    }

    public static function incorrectExperimentalAnnotationsFormatProvider(): \Generator
    {
        yield 'No properties added' => ['@experimental'];
        yield 'Added only stableVersion property' => ['@experimental stableVersion:v6.5.0'];
        yield 'Added only feature property' => ['@experimental feature:TEST_FEATURE'];
        yield 'Incorrect separator' => ['@experimental stableVersion=v6.5.0 feature1=testFeature'];
    }

    public function testExperimentalTagWithoutStableVersionPropertyThrowsException(): void
    {
$finder->notPath($path);
        }

        $invalidFiles = [];

        foreach ($finder->getIterator() as $file) {
            $filePath = $file->getRealPath();
            $content = (string) file_get_contents($filePath);

            try {
                $this->getDeprecationTagTester()->validateDeprecatedAnnotations($content);
                $this->getDeprecationTagTester()->validateExperimentalAnnotations($content);
            } catch (NoDeprecationFoundException|\InvalidArgumentException $error) {
                $invalidFiles[$filePath] = $error->getMessage();
            }
        }

        static::assertEmpty($invalidFilesprint_r($invalidFiles, true));
    }

    public function testConfigFilesForWrongDeprecatedTags(): void
    {
        $finder = new Finder();
        
Home | Imprint | This part of the site doesn't use cookies.