‪TYPO3CMS  11.5
MatcherFactoryTest.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 ‪MatcherFactoryTest extends UnitTestCase
27 {
31  public function ‪createAllThrowWithMissingClass(): void
32  {
33  $subject = new ‪MatcherFactory();
34  $this->expectException(\RuntimeException::class);
35  $this->expectExceptionCode(1501415721);
36  $configuration = [
37  [
38  'configurationFile' => 'foo',
39  ],
40  ];
41  $subject->createAll($configuration);
42  }
43 
48  {
49  $subject = new ‪MatcherFactory();
50  $this->expectException(\RuntimeException::class);
51  $this->expectExceptionCode(1501416365);
52  $configuration = [
53  [
54  'class' => \stdClass::class,
55  ],
56  ];
57  $subject->createAll($configuration);
58  }
59 
64  {
65  $subject = new ‪MatcherFactory();
66  $this->expectException(\RuntimeException::class);
67  $this->expectExceptionCode(1501419367);
68  $configuration = [
69  [
70  'class' => \stdClass::class,
71  'configurationFile' => 'foo',
72  'configurationArray' => [],
73  ],
74  ];
75  $subject->createAll($configuration);
76  }
77 
82  {
83  $subject = new ‪MatcherFactory();
84  $this->expectException(\RuntimeException::class);
85  $this->expectExceptionCode(1501509605);
86  $configuration = [
87  [
88  'class' => \stdClass::class,
89  'configurationFile' => 'EXT:install/does/not/exist.php',
90  ],
91  ];
92  $subject->createAll($configuration);
93  }
94 
99  {
100  $subject = new ‪MatcherFactory();
101  $this->expectException(\RuntimeException::class);
102  $this->expectExceptionCode(1501509548);
103  $configuration = [
104  [
105  'class' => \stdClass::class,
106  'configurationFile' => 'EXT:install/Tests/Unit/ExtensionScanner/Php/Fixtures/MatcherFactoryInvalidConfigurationFileFixture.php',
107  ],
108  ];
109  $subject->createAll($configuration);
110  }
111 
116  {
117  $subject = new ‪MatcherFactory();
118  $this->expectException(\RuntimeException::class);
119  $this->expectExceptionCode(1501509738);
120  $configuration = [
121  [
122  'class' => \stdClass::class,
123  'configurationArray' => 'foo',
124  ],
125  ];
126  $subject->createAll($configuration);
127  }
128 
133  {
134  $subject = new ‪MatcherFactory();
135  $this->expectException(\RuntimeException::class);
136  $this->expectExceptionCode(1501510168);
137  $configuration = [
138  [
139  'class' => \stdClass::class,
140  'configurationArray' => [],
141  ],
142  ];
143  $subject->createAll($configuration);
144  }
145 }
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\MatcherFactoryTest\createAllThrowsWithMissingConfiguration
‪createAllThrowsWithMissingConfiguration()
Definition: MatcherFactoryTest.php:47
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\MatcherFactoryTest
Definition: MatcherFactoryTest.php:27
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\MatcherFactoryTest\createAllThrowsWithBothConfigurationFileAndConfigurationArray
‪createAllThrowsWithBothConfigurationFileAndConfigurationArray()
Definition: MatcherFactoryTest.php:63
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php
Definition: CodeStatisticsTest.php:18
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\MatcherFactoryTest\createAllThrowsIfConfigurationFileDoesNotExist
‪createAllThrowsIfConfigurationFileDoesNotExist()
Definition: MatcherFactoryTest.php:81
‪TYPO3\CMS\Install\ExtensionScanner\Php\MatcherFactory
Definition: MatcherFactory.php:29
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\MatcherFactoryTest\createAllThrowsIfConfigurationFileDoesNotReturnArray
‪createAllThrowsIfConfigurationFileDoesNotReturnArray()
Definition: MatcherFactoryTest.php:98
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\MatcherFactoryTest\createAllThrowsIfConfigurationArrayIsNotAnArray
‪createAllThrowsIfConfigurationArrayIsNotAnArray()
Definition: MatcherFactoryTest.php:115
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\MatcherFactoryTest\createAllThrowWithMissingClass
‪createAllThrowWithMissingClass()
Definition: MatcherFactoryTest.php:31
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\MatcherFactoryTest\createAllThrowIfMatcherDoesNotImplementCodeScannerInterface
‪createAllThrowIfMatcherDoesNotImplementCodeScannerInterface()
Definition: MatcherFactoryTest.php:132