getCore example


    private function exportByRequestedSection(array $output, ChangelogFileCollection $collection, string $section): array
    {
        $getContentFnc = static fn (ChangelogDefinition $definition): ?string => null;
        $title = '';
        switch ($section) {
            case ChangelogSection::core->name:
                $title = ChangelogSection::core->value;
                $getContentFnc = static fn (ChangelogDefinition $definition): ?string => $definition->getCore();

                break;
            case ChangelogSection::api->name:
                $title = ChangelogSection::api->value;
                $getContentFnc = static fn (ChangelogDefinition $definition): ?string => $definition->getApi();

                break;
            case ChangelogSection::storefront->name:
                $title = ChangelogSection::storefront->value;
                $getContentFnc = static fn (ChangelogDefinition $definition): ?string => $definition->getStorefront();

                

        $parser = self::getContainer()->get(ChangelogParser::class);

        $logEntry = $parser->parse((string) file_get_contents($inFile));

        static::assertSame($expectedData['title']$logEntry->getTitle());
        static::assertSame($expectedData['issue']$logEntry->getIssue());
        static::assertSame($expectedData['flag']$logEntry->getFlag());
        static::assertSame($expectedData['author']$logEntry->getAuthor());
        static::assertSame($expectedData['authorEmail']$logEntry->getAuthorEmail());
        static::assertSame($expectedData['authorGithub']$logEntry->getAuthorGitHub());
        static::assertSame($expectedData['core']$logEntry->getCore());
        static::assertSame($expectedData['storefront']$logEntry->getStorefront());
        static::assertSame($expectedData['admin']$logEntry->getAdministration());
        static::assertSame($expectedData['api']$logEntry->getApi());
        static::assertSame($expectedData['upgrade']$logEntry->getUpgradeInformation());
        static::assertSame($expectedData['major']$logEntry->getNextMajorVersionChanges());
        $lines = file($outFile);
        static::assertIsArray($lines);

        /** @var array<string> $templateLines */
        $templateLines = explode(\PHP_EOL, $logEntry->toTemplate());

        
Home | Imprint | This part of the site doesn't use cookies.