‪TYPO3CMS  9.5
AbstractCoreMatcherTest.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
20 
24 class ‪AbstractCoreMatcherTest extends UnitTestCase
25 {
30  {
31  $matcher = $this->getAccessibleMockForAbstractClass(AbstractCoreMatcher::class, [], '', false);
32  $configuration = [
33  'foo/bar->baz' => [
34  'requiredArg1' => 42,
35  'restFiles' => [
36  'aRest.rst',
37  ],
38  ],
39  ];
40  $matcher->_set('matcherDefinitions', $configuration);
41  $matcher->_call('validateMatcherDefinitions', ['requiredArg1']);
42  }
43 
48  {
49  $matcher = $this->getAccessibleMockForAbstractClass(AbstractCoreMatcher::class, [], '', false);
50  $configuration = [
51  'foo/bar->baz' => [
52  'someNotRequiredConfig' => '',
53  'restFiles' => [
54  'aRest.rst',
55  ],
56  ],
57  ];
58  $matcher->_set('matcherDefinitions', $configuration);
59  $this->expectException(\InvalidArgumentException::class);
60  $this->expectExceptionCode(1500492001);
61  $matcher->_call('validateMatcherDefinitions', ['requiredArg1']);
62  }
63 
68  {
69  $matcher = $this->getAccessibleMockForAbstractClass(AbstractCoreMatcher::class, [], '', false);
70  $configuration = [
71  'foo/bar->baz' => [
72  'restFiles' => [],
73  ],
74  ];
75  $matcher->_set('matcherDefinitions', $configuration);
76  $this->expectException(\InvalidArgumentException::class);
77  $this->expectExceptionCode(1500496068);
78  $matcher->_call('validateMatcherDefinitions', []);
79  }
80 
85  {
86  $matcher = $this->getAccessibleMockForAbstractClass(AbstractCoreMatcher::class, [], '', false);
87  $configuration = [
88  'foo/bar->baz' => [
89  'restFiles' => [
90  'foo.rst',
91  '',
92  ],
93  ],
94  ];
95  $matcher->_set('matcherDefinitions', $configuration);
96  $this->expectException(\InvalidArgumentException::class);
97  $this->expectExceptionCode(1500735983);
98  $matcher->_call('validateMatcherDefinitions', []);
99  }
100 
105  {
106  $matcher = $this->getAccessibleMockForAbstractClass(AbstractCoreMatcher::class, [], '', false);
107  $configuration = [
108  'no\method\given' => [
109  'restFiles' => [],
110  ],
111  ];
112  $matcher->_set('matcherDefinitions', $configuration);
113  $this->expectException(\RuntimeException::class);
114  $this->expectExceptionCode(1500557309);
115  $matcher->_call('initializeFlatMatcherDefinitions');
116  }
117 }
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\AbstractCoreMatcherTest\validateMatcherDefinitionsThrowsWithEmptySingleRestFile
‪validateMatcherDefinitionsThrowsWithEmptySingleRestFile()
Definition: AbstractCoreMatcherTest.php:84
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\AbstractCoreMatcherTest\validateMatcherDefinitionsThrowsIfRequiredArgIsNotInConfig
‪validateMatcherDefinitionsThrowsIfRequiredArgIsNotInConfig()
Definition: AbstractCoreMatcherTest.php:47
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\AbstractCoreMatcher
Definition: AbstractCoreMatcher.php:32
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\AbstractCoreMatcherTest\initializeMethodNameArrayThrowsWithInvalidKeys
‪initializeMethodNameArrayThrowsWithInvalidKeys()
Definition: AbstractCoreMatcherTest.php:104
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\AbstractCoreMatcherTest
Definition: AbstractCoreMatcherTest.php:25
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher
Definition: AbstractCoreMatcherTest.php:3
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\AbstractCoreMatcherTest\validateMatcherDefinitionsRunsFineWithProperDefinition
‪validateMatcherDefinitionsRunsFineWithProperDefinition()
Definition: AbstractCoreMatcherTest.php:29
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\AbstractCoreMatcherTest\validateMatcherDefinitionsThrowsWithMissingRestFiles
‪validateMatcherDefinitionsThrowsWithMissingRestFiles()
Definition: AbstractCoreMatcherTest.php:67