‪TYPO3CMS  ‪main
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 
23 final class ‪AbstractCoreMatcherTest extends UnitTestCase
24 {
29  {
30  $matcher = $this->getAccessibleMockForAbstractClass(AbstractCoreMatcher::class, [], '', false);
31  $configuration = [
32  'foo/bar->baz' => [
33  'requiredArg1' => 42,
34  'restFiles' => [
35  'aRest.rst',
36  ],
37  ],
38  ];
39  $matcher->_set('matcherDefinitions', $configuration);
40  $matcher->_call('validateMatcherDefinitions', ['requiredArg1']);
41  }
42 
47  {
48  $matcher = $this->getAccessibleMockForAbstractClass(AbstractCoreMatcher::class, [], '', false);
49  $configuration = [
50  'foo/bar->baz' => [
51  'someNotRequiredConfig' => '',
52  'restFiles' => [
53  'aRest.rst',
54  ],
55  ],
56  ];
57  $matcher->_set('matcherDefinitions', $configuration);
58  $this->expectException(\InvalidArgumentException::class);
59  $this->expectExceptionCode(1500492001);
60  $matcher->_call('validateMatcherDefinitions', ['requiredArg1']);
61  }
62 
67  {
68  $matcher = $this->getAccessibleMockForAbstractClass(AbstractCoreMatcher::class, [], '', false);
69  $configuration = [
70  'foo/bar->baz' => [
71  'restFiles' => [],
72  ],
73  ];
74  $matcher->_set('matcherDefinitions', $configuration);
75  $this->expectException(\InvalidArgumentException::class);
76  $this->expectExceptionCode(1500496068);
77  $matcher->_call('validateMatcherDefinitions', []);
78  }
79 
84  {
85  $matcher = $this->getAccessibleMockForAbstractClass(AbstractCoreMatcher::class, [], '', false);
86  $configuration = [
87  'foo/bar->baz' => [
88  'restFiles' => [
89  'foo.rst',
90  '',
91  ],
92  ],
93  ];
94  $matcher->_set('matcherDefinitions', $configuration);
95  $this->expectException(\InvalidArgumentException::class);
96  $this->expectExceptionCode(1500735983);
97  $matcher->_call('validateMatcherDefinitions', []);
98  }
99 
104  {
105  $matcher = $this->getAccessibleMockForAbstractClass(AbstractCoreMatcher::class, [], '', false);
106  $configuration = [
107  'no\method\given' => [
108  'restFiles' => [],
109  ],
110  ];
111  $matcher->_set('matcherDefinitions', $configuration);
112  $this->expectException(\RuntimeException::class);
113  $this->expectExceptionCode(1500557309);
114  $matcher->_call('initializeFlatMatcherDefinitions');
115  }
116 }
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\AbstractCoreMatcherTest\validateMatcherDefinitionsThrowsWithEmptySingleRestFile
‪validateMatcherDefinitionsThrowsWithEmptySingleRestFile()
Definition: AbstractCoreMatcherTest.php:83
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\AbstractCoreMatcherTest\validateMatcherDefinitionsThrowsIfRequiredArgIsNotInConfig
‪validateMatcherDefinitionsThrowsIfRequiredArgIsNotInConfig()
Definition: AbstractCoreMatcherTest.php:46
‪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:103
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\AbstractCoreMatcherTest
Definition: AbstractCoreMatcherTest.php:24
‪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:28
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\AbstractCoreMatcherTest\validateMatcherDefinitionsThrowsWithMissingRestFiles
‪validateMatcherDefinitionsThrowsWithMissingRestFiles()
Definition: AbstractCoreMatcherTest.php:66