2 declare(strict_types = 1);
19 use org\bovigo\vfs\vfsStream;
20 use org\bovigo\vfs\vfsStreamDirectory;
21 use Prophecy\Argument;
24 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
50 'Breaking: #12345 - Issue',
57 'Important: #45678 - Issue',
60 'Some more text content',
65 'Important: #98574 - Issue',
74 'Breaking: #13579 - Issue',
83 'Breaking-12345-Issue.rst' => implode(
"\n", $content_12345),
84 'Important-45678-Issue.rst' => implode(
"\n", $content_45678),
88 'Important-98574-Issue.rst' => implode(
"\n", $content_98574),
91 'Breaking-13579-Issue.rst' => implode(
"\n", $content_13579),
92 'Important-13579-Issue.rst' => implode(
"\n", $content_13579),
98 $this->docRoot = vfsStream::setup(
'root',
null, $structure);
100 $this->registry = $this->prophesize(Registry::class);
102 $this->registry->reveal(),
103 vfsStream::url(
'root/Changelog')
121 'etc/passwd' =>
'/etc/passwd'
132 $this->expectException(\InvalidArgumentException::class);
133 $this->expectExceptionCode(1485425530);
149 $result = $this->documentationFileService->findDocumentationDirectories(vfsStream::url(
'root/Changelog'));
150 self::assertEquals(array_keys($expected), $result);
158 $result = $this->documentationFileService->findDocumentationFiles(vfsStream::url(
'root/Changelog/master'));
159 $this->assertCount(2, $result);
171 $result = $this->documentationFileService->findDocumentationFiles(vfsStream::url(
'root/Changelog/2.0'));
172 $key = md5(
'vfs://root/Changelog/2.0/Important-98574-Issue.rst');
173 self::assertEquals($expected, $result[$key][
'tags']);
181 $ignoredFiles = [
'vfs://root/Changelog/1.2/Breaking-12345-Issue.rst'];
182 $this->registry->get(
183 'upgradeAnalysisIgnoreFilter',
184 'ignoredDocumentationFiles',
186 )->willReturn($ignoredFiles);
188 $result = $this->documentationFileService->findDocumentationFiles(vfsStream::url(
'root/Changelog/1.2'));
189 self::assertArrayNotHasKey(12345, $result);
198 [
'/etc/passwd' =>
'/etc/passwd'],
210 $this->expectException(\InvalidArgumentException::class);
211 $this->expectExceptionCode(1485425531);
212 $this->documentationFileService->getListEntry($path);