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