‪TYPO3CMS  11.5
AbstractCoreMatcherTest.php
Go to the documentation of this file.
1 <?php
2 
3 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 
21 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
22 
26 class ‪AbstractCoreMatcherTest extends UnitTestCase
27 {
32  {
33  $matcher = $this->getAccessibleMockForAbstractClass(AbstractCoreMatcher::class, [], '', false);
34  $configuration = [
35  'foo/bar->baz' => [
36  'requiredArg1' => 42,
37  'restFiles' => [
38  'aRest.rst',
39  ],
40  ],
41  ];
42  $matcher->_set('matcherDefinitions', $configuration);
43  $matcher->_call('validateMatcherDefinitions', ['requiredArg1']);
44  }
45 
50  {
51  $matcher = $this->getAccessibleMockForAbstractClass(AbstractCoreMatcher::class, [], '', false);
52  $configuration = [
53  'foo/bar->baz' => [
54  'someNotRequiredConfig' => '',
55  'restFiles' => [
56  'aRest.rst',
57  ],
58  ],
59  ];
60  $matcher->_set('matcherDefinitions', $configuration);
61  $this->expectException(\InvalidArgumentException::class);
62  $this->expectExceptionCode(1500492001);
63  $matcher->_call('validateMatcherDefinitions', ['requiredArg1']);
64  }
65 
70  {
71  $matcher = $this->getAccessibleMockForAbstractClass(AbstractCoreMatcher::class, [], '', false);
72  $configuration = [
73  'foo/bar->baz' => [
74  'restFiles' => [],
75  ],
76  ];
77  $matcher->_set('matcherDefinitions', $configuration);
78  $this->expectException(\InvalidArgumentException::class);
79  $this->expectExceptionCode(1500496068);
80  $matcher->_call('validateMatcherDefinitions', []);
81  }
82 
87  {
88  $matcher = $this->getAccessibleMockForAbstractClass(AbstractCoreMatcher::class, [], '', false);
89  $configuration = [
90  'foo/bar->baz' => [
91  'restFiles' => [
92  'foo.rst',
93  '',
94  ],
95  ],
96  ];
97  $matcher->_set('matcherDefinitions', $configuration);
98  $this->expectException(\InvalidArgumentException::class);
99  $this->expectExceptionCode(1500735983);
100  $matcher->_call('validateMatcherDefinitions', []);
101  }
102 
107  {
108  $matcher = $this->getAccessibleMockForAbstractClass(AbstractCoreMatcher::class, [], '', false);
109  $configuration = [
110  'no\method\given' => [
111  'restFiles' => [],
112  ],
113  ];
114  $matcher->_set('matcherDefinitions', $configuration);
115  $this->expectException(\RuntimeException::class);
116  $this->expectExceptionCode(1500557309);
117  $matcher->_call('initializeFlatMatcherDefinitions');
118  }
119 }
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\AbstractCoreMatcherTest\validateMatcherDefinitionsThrowsWithEmptySingleRestFile
‪validateMatcherDefinitionsThrowsWithEmptySingleRestFile()
Definition: AbstractCoreMatcherTest.php:86
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\AbstractCoreMatcherTest\validateMatcherDefinitionsThrowsIfRequiredArgIsNotInConfig
‪validateMatcherDefinitionsThrowsIfRequiredArgIsNotInConfig()
Definition: AbstractCoreMatcherTest.php:49
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\AbstractCoreMatcher
Definition: AbstractCoreMatcher.php:34
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\AbstractCoreMatcherTest\initializeMethodNameArrayThrowsWithInvalidKeys
‪initializeMethodNameArrayThrowsWithInvalidKeys()
Definition: AbstractCoreMatcherTest.php:106
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\AbstractCoreMatcherTest
Definition: AbstractCoreMatcherTest.php:27
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher
Definition: AbstractCoreMatcherTest.php:18
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\AbstractCoreMatcherTest\validateMatcherDefinitionsRunsFineWithProperDefinition
‪validateMatcherDefinitionsRunsFineWithProperDefinition()
Definition: AbstractCoreMatcherTest.php:31
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\AbstractCoreMatcherTest\validateMatcherDefinitionsThrowsWithMissingRestFiles
‪validateMatcherDefinitionsThrowsWithMissingRestFiles()
Definition: AbstractCoreMatcherTest.php:69