‪TYPO3CMS  9.5
DependencyUtilityTest.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
22 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
23 
27 class ‪DependencyUtilityTest extends UnitTestCase
28 {
32  protected ‪$objectManagerMock;
33 
37  protected function ‪setUp()
38  {
39  $this->objectManagerMock = $this->getMockBuilder(\‪TYPO3\CMS\‪Extbase\Object\ObjectManagerInterface::class)->getMock();
40  }
41 
46  {
48  $dependencyMock = $this->getMockBuilder(Dependency::class)
49  ->setMethods(['getHighestVersion', 'getLowestVersion'])
50  ->getMock();
51  $dependencyMock->expects($this->atLeastOnce())->method('getLowestVersion')->will($this->returnValue('15.0.0'));
52  $dependencyMock->setIdentifier('typo3');
53  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['dummy']);
54 
55  $this->expectException(ExtensionManagerException::class);
56  $this->expectExceptionCode(1399144499);
57  $dependencyUtility->_call('checkTypo3Dependency', $dependencyMock);
58  }
59 
64  {
66  $dependencyMock = $this->getMockBuilder(Dependency::class)
67  ->setMethods(['getHighestVersion', 'getLowestVersion'])
68  ->getMock();
69  $dependencyMock->expects($this->atLeastOnce())->method('getHighestVersion')->will($this->returnValue('3.0.0'));
70  $dependencyMock->expects($this->atLeastOnce())->method('getLowestVersion')->will($this->returnValue('1.0.0'));
71  $dependencyMock->setIdentifier('typo3');
72  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['dummy']);
73 
74  $this->expectException(ExtensionManagerException::class);
75  $this->expectExceptionCode(1399144521);
76  $dependencyUtility->_call('checkTypo3Dependency', $dependencyMock);
77  }
78 
83  {
85  $dependencyMock = $this->getMockBuilder(Dependency::class)
86  ->setMethods(['getHighestVersion', 'getLowestVersion'])
87  ->getMock();
88  $dependencyMock->setIdentifier('123');
89  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['dummy']);
90 
91  $this->expectException(ExtensionManagerException::class);
92  $this->expectExceptionCode(1399144551);
93  $dependencyUtility->_call('checkTypo3Dependency', $dependencyMock);
94  }
95 
100  {
102  $dependencyMock = $this->getMockBuilder(Dependency::class)
103  ->setMethods(['getHighestVersion', 'getLowestVersion'])
104  ->getMock();
105  $dependencyMock->expects($this->atLeastOnce())->method('getHighestVersion')->will($this->returnValue('15.0.0'));
106  $dependencyMock->expects($this->atLeastOnce())->method('getLowestVersion')->will($this->returnValue('1.0.0'));
107  $dependencyMock->setIdentifier('typo3');
108  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['dummy']);
109 
110  $this->assertTrue($dependencyUtility->_call('checkTypo3Dependency', $dependencyMock));
111  }
112 
117  {
119  $dependencyMock = $this->getMockBuilder(Dependency::class)
120  ->setMethods(['getHighestVersion', 'getLowestVersion'])
121  ->getMock();
122  $dependencyMock->expects($this->atLeastOnce())->method('getHighestVersion')->will($this->returnValue(''));
123  $dependencyMock->expects($this->atLeastOnce())->method('getLowestVersion')->will($this->returnValue('1.0.0'));
124  $dependencyMock->setIdentifier('typo3');
125  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['dummy']);
126 
127  $this->assertTrue($dependencyUtility->_call('checkTypo3Dependency', $dependencyMock));
128  }
129 
134  {
136  $dependencyMock = $this->getMockBuilder(Dependency::class)
137  ->setMethods(['getHighestVersion', 'getLowestVersion'])
138  ->getMock();
139  $dependencyMock->expects($this->atLeastOnce())->method('getHighestVersion')->will($this->returnValue('15.0.0'));
140  $dependencyMock->expects($this->atLeastOnce())->method('getLowestVersion')->will($this->returnValue(''));
141  $dependencyMock->setIdentifier('typo3');
142  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['dummy']);
143 
144  $this->assertTrue($dependencyUtility->_call('checkTypo3Dependency', $dependencyMock));
145  }
146 
151  {
153  $dependencyMock = $this->getMockBuilder(Dependency::class)
154  ->setMethods(['getHighestVersion', 'getLowestVersion'])
155  ->getMock();
156  $dependencyMock->expects($this->atLeastOnce())->method('getLowestVersion')->will($this->returnValue('15.0.0'));
157  $dependencyMock->setIdentifier('php');
158  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['dummy']);
159 
160  $this->expectException(ExtensionManagerException::class);
161  $this->expectExceptionCode(1377977857);
162  $dependencyUtility->_call('checkPhpDependency', $dependencyMock);
163  }
164 
169  {
171  $dependencyMock = $this->getMockBuilder(Dependency::class)
172  ->setMethods(['getHighestVersion', 'getLowestVersion'])
173  ->getMock();
174  $dependencyMock->expects($this->atLeastOnce())->method('getHighestVersion')->will($this->returnValue('3.0.0'));
175  $dependencyMock->expects($this->atLeastOnce())->method('getLowestVersion')->will($this->returnValue('1.0.0'));
176  $dependencyMock->setIdentifier('php');
177  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['dummy']);
178 
179  $this->expectException(ExtensionManagerException::class);
180  $this->expectExceptionCode(1377977856);
181  $dependencyUtility->_call('checkPhpDependency', $dependencyMock);
182  }
183 
188  {
190  $dependencyMock = $this->getMockBuilder(Dependency::class)
191  ->setMethods(['getHighestVersion', 'getLowestVersion'])
192  ->getMock();
193  $dependencyMock->setIdentifier('123');
194  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['dummy']);
195 
196  $this->expectException(ExtensionManagerException::class);
197  $this->expectExceptionCode(1377977858);
198  $dependencyUtility->_call('checkPhpDependency', $dependencyMock);
199  }
200 
205  {
207  $dependencyMock = $this->getMockBuilder(Dependency::class)
208  ->setMethods(['getHighestVersion', 'getLowestVersion'])
209  ->getMock();
210  $dependencyMock->expects($this->atLeastOnce())->method('getHighestVersion')->will($this->returnValue('15.0.0'));
211  $dependencyMock->expects($this->atLeastOnce())->method('getLowestVersion')->will($this->returnValue('1.0.0'));
212  $dependencyMock->setIdentifier('php');
213  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['dummy']);
214 
215  $this->assertTrue($dependencyUtility->_call('checkPhpDependency', $dependencyMock));
216  }
217 
222  {
224  $dependencyMock = $this->getMockBuilder(Dependency::class)
225  ->setMethods(['getHighestVersion', 'getLowestVersion'])
226  ->getMock();
227  $dependencyMock->expects($this->atLeastOnce())->method('getHighestVersion')->will($this->returnValue(''));
228  $dependencyMock->expects($this->atLeastOnce())->method('getLowestVersion')->will($this->returnValue('1.0.0'));
229  $dependencyMock->setIdentifier('php');
230  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['dummy']);
231 
232  $this->assertTrue($dependencyUtility->_call('checkPhpDependency', $dependencyMock));
233  }
234 
239  {
241  $dependencyMock = $this->getMockBuilder(Dependency::class)
242  ->setMethods(['getHighestVersion', 'getLowestVersion'])
243  ->getMock();
244  $dependencyMock->expects($this->atLeastOnce())->method('getHighestVersion')->will($this->returnValue('15.0.0'));
245  $dependencyMock->expects($this->atLeastOnce())->method('getLowestVersion')->will($this->returnValue(''));
246  $dependencyMock->setIdentifier('php');
247  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['dummy']);
248 
249  $this->assertTrue($dependencyUtility->_call('checkPhpDependency', $dependencyMock));
250  }
251 
256  {
258  $extensionMock = $this->getMockBuilder(Extension::class)
259  ->setMethods(['dummy'])
260  ->getMock();
262  $dependencyMock = $this->getMockBuilder(Dependency::class)
263  ->setMethods(['getHighestVersion', 'getLowestVersion'])
264  ->getMock();
265  $dependencyMock->setIdentifier('php');
266  $dependencyStorage = new \SplObjectStorage();
267  $dependencyStorage->attach($dependencyMock);
268  $extensionMock->setDependencies($dependencyStorage);
270  $dependencyUtility = $this->getMockBuilder(DependencyUtility::class)
271  ->setMethods(['checkPhpDependency', 'checkTypo3Dependency'])
272  ->getMock();
273  $dependencyUtility->expects($this->atLeastOnce())->method('checkPhpDependency');
274  $dependencyUtility->checkDependencies($extensionMock);
275  }
276 
281  {
283  $extensionMock = $this->getMockBuilder(Extension::class)
284  ->setMethods(['dummy'])
285  ->getMock();
287  $dependencyMock = $this->getMockBuilder(Dependency::class)
288  ->setMethods(['getHighestVersion', 'getLowestVersion'])
289  ->getMock();
290  $dependencyMock->setIdentifier('typo3');
291  $dependencyStorage = new \SplObjectStorage();
292  $dependencyStorage->attach($dependencyMock);
293  $extensionMock->setDependencies($dependencyStorage);
295  $dependencyUtility = $this->getMockBuilder(DependencyUtility::class)
296  ->setMethods(['checkPhpDependency', 'checkTypo3Dependency'])
297  ->getMock();
298 
299  $dependencyUtility->expects($this->atLeastOnce())->method('checkTypo3Dependency');
300  $dependencyUtility->checkDependencies($extensionMock);
301  }
302 
307  {
309  $dependencyMock = $this->getMockBuilder(Dependency::class)
310  ->setMethods(['getHighestVersion', 'getLowestVersion'])
311  ->getMock();
312  $dependencyMock->expects($this->atLeastOnce())->method('getHighestVersion')->will($this->returnValue('15.0.0'));
313  $dependencyMock->expects($this->atLeastOnce())->method('getLowestVersion')->will($this->returnValue('1.0.0'));
314  $version = '3.3.3';
315  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['dummy']);
316 
317  $this->assertTrue($dependencyUtility->_call('isVersionCompatible', $version, $dependencyMock));
318  }
319 
324  {
326  $dependencyMock = $this->getMockBuilder(Dependency::class)
327  ->setMethods(['getHighestVersion', 'getLowestVersion'])
328  ->getMock();
329  $dependencyMock->expects($this->atLeastOnce())->method('getHighestVersion')->will($this->returnValue('1.0.1'));
330  $dependencyMock->expects($this->atLeastOnce())->method('getLowestVersion')->will($this->returnValue('1.0.0'));
331  $version = '3.3.3';
332  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['dummy']);
333 
334  $this->assertFalse($dependencyUtility->_call('isVersionCompatible', $version, $dependencyMock));
335  }
336 
341  {
342  $availableExtensions = [
343  'dummy' => [],
344  'foo' => [],
345  'bar' => []
346  ];
347  $listUtilityMock = $this->getMockBuilder(\‪TYPO3\CMS\Extensionmanager\Utility\ListUtility::class)
348  ->setMethods(['getAvailableExtensions'])
349  ->getMock();
350  $listUtilityMock->expects($this->atLeastOnce())->method('getAvailableExtensions')->will($this->returnValue($availableExtensions));
351  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['dummy']);
352  $dependencyUtility->_set('listUtility', $listUtilityMock);
353 
354  $this->assertTrue($dependencyUtility->_call('isDependentExtensionAvailable', 'dummy'));
355  }
356 
361  {
362  $availableExtensions = [
363  'dummy' => [],
364  'foo' => [],
365  'bar' => []
366  ];
367  $listUtilityMock = $this->getMockBuilder(\‪TYPO3\CMS\Extensionmanager\Utility\ListUtility::class)
368  ->setMethods(['getAvailableExtensions'])
369  ->getMock();
370  $listUtilityMock->expects($this->atLeastOnce())->method('getAvailableExtensions')->will($this->returnValue($availableExtensions));
371  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['dummy']);
372  $dependencyUtility->_set('listUtility', $listUtilityMock);
373 
374  $this->assertFalse($dependencyUtility->_call('isDependentExtensionAvailable', '42'));
375  }
376 
381  {
382  $emConfUtility = $this->getMockBuilder(\‪TYPO3\CMS\Extensionmanager\Utility\EmConfUtility::class)
383  ->setMethods(['includeEmConf'])
384  ->getMock();
385  $emConfUtility->expects($this->once())->method('includeEmConf')->will($this->returnValue([
386  'key' => 'dummy',
387  'version' => '1.0.0'
388  ]));
389  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['setAvailableExtensions', 'isVersionCompatible']);
390  $dependencyMock = $this->getMockBuilder(Dependency::class)
391  ->setMethods(['getIdentifier'])
392  ->getMock();
393  $dependencyMock->expects($this->once())->method('getIdentifier')->will($this->returnValue('dummy'));
394  $dependencyUtility->_set('emConfUtility', $emConfUtility);
395  $dependencyUtility->_set('availableExtensions', [
396  'dummy' => [
397  'foo' => '42'
398  ]
399  ]);
400  $dependencyUtility->expects($this->once())->method('setAvailableExtensions');
401  $dependencyUtility->expects($this->once())->method('isVersionCompatible')->with('1.0.0', $this->anything());
402  $dependencyUtility->_call('isAvailableVersionCompatible', $dependencyMock);
403  }
404 
409  {
410  $extensionRepositoryMock = $this->getMockBuilder(ExtensionRepository::class)
411  ->setMethods(['countByExtensionKey'])
412  ->setConstructorArgs([$this->objectManagerMock])
413  ->getMock();
414  $extensionRepositoryMock->expects($this->once())->method('countByExtensionKey')->with('test123')->will($this->returnValue(1));
415  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['dummy']);
416  $dependencyUtility->_set('extensionRepository', $extensionRepositoryMock);
417  $count = $dependencyUtility->_call('isExtensionDownloadableFromTer', 'test123');
418 
419  $this->assertTrue($count);
420  }
421 
426  {
427  $extensionRepositoryMock = $this->getMockBuilder(ExtensionRepository::class)
428  ->setMethods(['countByExtensionKey'])
429  ->setConstructorArgs([$this->objectManagerMock])
430  ->getMock();
431  $extensionRepositoryMock->expects($this->once())->method('countByExtensionKey')->with('test123')->will($this->returnValue(0));
432  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['dummy']);
433  $dependencyUtility->_set('extensionRepository', $extensionRepositoryMock);
434  $count = $dependencyUtility->_call('isExtensionDownloadableFromTer', 'test123');
435 
436  $this->assertFalse($count);
437  }
438 
443  {
444  $dependencyMock = $this->getMockBuilder(Dependency::class)
445  ->setMethods(['getIdentifier', 'getHighestVersion', 'getLowestVersion'])
446  ->getMock();
447  $dependencyMock->expects($this->once())->method('getIdentifier')->will($this->returnValue('dummy'));
448  $dependencyMock->expects($this->once())->method('getHighestVersion')->will($this->returnValue('10.0.0'));
449  $dependencyMock->expects($this->once())->method('getLowestVersion')->will($this->returnValue('1.0.0'));
450  $extensionRepositoryMock = $this->getMockBuilder(ExtensionRepository::class)
451  ->setMethods(['countByVersionRangeAndExtensionKey'])
452  ->setConstructorArgs([$this->objectManagerMock])
453  ->getMock();
454  $extensionRepositoryMock->expects($this->once())->method('countByVersionRangeAndExtensionKey')->with('dummy', 1000000, 10000000)->will($this->returnValue(2));
455  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['dummy']);
456  $dependencyUtility->_set('extensionRepository', $extensionRepositoryMock);
457  $count = $dependencyUtility->_call('isDownloadableVersionCompatible', $dependencyMock);
458 
459  $this->assertTrue($count);
460  }
461 
466  {
467  $dependencyMock = $this->getMockBuilder(Dependency::class)
468  ->setMethods(['getIdentifier'])
469  ->getMock();
470  $dependencyMock->expects($this->once())->method('getIdentifier')->will($this->returnValue('dummy'));
471  $extensionRepositoryMock = $this->getMockBuilder(ExtensionRepository::class)
472  ->setMethods(['countByVersionRangeAndExtensionKey'])
473  ->setConstructorArgs([$this->objectManagerMock])
474  ->getMock();
475  $extensionRepositoryMock->expects($this->once())->method('countByVersionRangeAndExtensionKey')->with('dummy', 1000000, 2000000)->will($this->returnValue(0));
476  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['getLowestAndHighestIntegerVersions']);
477  $dependencyUtility->_set('extensionRepository', $extensionRepositoryMock);
478  $dependencyUtility->expects($this->once())->method('getLowestAndHighestIntegerVersions')->will($this->returnValue([
479  'lowestIntegerVersion' => 1000000,
480  'highestIntegerVersion' => 2000000
481  ]));
482  $count = $dependencyUtility->_call('isDownloadableVersionCompatible', $dependencyMock);
483 
484  $this->assertFalse($count);
485  }
486 
491  {
492  $expectedVersions = [
493  'lowestIntegerVersion' => 1000000,
494  'highestIntegerVersion' => 2000000
495  ];
496 
497  $dependencyMock = $this->getMockBuilder(Dependency::class)
498  ->setMethods(['getHighestVersion', 'getLowestVersion'])
499  ->getMock();
500  $dependencyMock->expects($this->once())->method('getHighestVersion')->will($this->returnValue('2.0.0'));
501  $dependencyMock->expects($this->once())->method('getLowestVersion')->will($this->returnValue('1.0.0'));
502  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['dummy']);
503  $versions = $dependencyUtility->_call('getLowestAndHighestIntegerVersions', $dependencyMock);
504 
505  $this->assertSame($expectedVersions, $versions);
506  }
507 
512  {
513  $suitableDependency = new ‪Dependency();
514  $suitableDependency->setIdentifier('typo3');
515  $suitableDependency->setLowestVersion('3.6.1');
516 
517  $suitableDependencies = new \SplObjectStorage();
518  $suitableDependencies->attach($suitableDependency);
519 
520  $unsuitableDependency = new ‪Dependency();
521  $unsuitableDependency->setIdentifier('typo3');
522  $unsuitableDependency->setHighestVersion('4.3.0');
523 
524  $unsuitableDependencies = new \SplObjectStorage();
525  $unsuitableDependencies->attach($unsuitableDependency);
526 
527  $extension1 = new ‪Extension();
528  $extension1->setExtensionKey('foo');
529  $extension1->setVersion('1.0.0');
530  $extension1->setDependencies($unsuitableDependencies);
531 
532  $extension2 = new ‪Extension();
533  $extension2->setExtensionKey('bar');
534  $extension2->setVersion('1.0.42');
535  $extension2->setDependencies($suitableDependencies);
536 
537  $myStorage = new \TYPO3\CMS\Extensionmanager\Tests\Unit\Fixtures\LatestCompatibleExtensionObjectStorageFixture();
538  $myStorage->extensions[] = $extension1;
539  $myStorage->extensions[] = $extension2;
540  $dependencyMock = $this->getMockBuilder(Dependency::class)
541  ->setMethods(['getIdentifier'])
542  ->getMock();
543  $dependencyMock->expects($this->once())->method('getIdentifier')->will($this->returnValue('foobar'));
544  $dependencyUtility = $this->getAccessibleMock(DependencyUtility::class, ['getLowestAndHighestIntegerVersions']);
545  $dependencyUtility->expects($this->once())->method('getLowestAndHighestIntegerVersions')->will($this->returnValue([
546  'lowestIntegerVersion' => 1000000,
547  'highestIntegerVersion' => 2000000
548  ]));
549  $extensionRepositoryMock = $this->getMockBuilder(ExtensionRepository::class)
550  ->setMethods(['findByVersionRangeAndExtensionKeyOrderedByVersion'])
551  ->setConstructorArgs([$this->objectManagerMock])
552  ->getMock();
553  $extensionRepositoryMock->expects($this->once())->method('findByVersionRangeAndExtensionKeyOrderedByVersion')->with('foobar', 1000000, 2000000)->will($this->returnValue($myStorage));
554  $dependencyUtility->_set('extensionRepository', $extensionRepositoryMock);
555  $extension = $dependencyUtility->_call('getLatestCompatibleExtensionByIntegerVersionDependency', $dependencyMock);
556 
557  $this->assertInstanceOf(Extension::class, $extension);
558  $this->assertSame('bar', $extension->getExtensionKey());
559  }
560 
565  {
566  // foo2 should be kept
567  $foo1 = new ‪Extension();
568  $foo1->setExtensionKey('foo');
569  $foo1->setVersion('1.0.0');
570  $foo2 = new ‪Extension();
571  $foo2->setExtensionKey('foo');
572  $foo2->setVersion('1.0.1');
573 
574  // bar1 should be kept
575  $bar1 = new ‪Extension();
576  $bar1->setExtensionKey('bar');
577  $bar1->setVersion('1.1.2');
578  $bar2 = new ‪Extension();
579  $bar2->setExtensionKey('bar');
580  $bar2->setVersion('1.1.1');
581  $bar3 = new ‪Extension();
582  $bar3->setExtensionKey('bar');
583  $bar3->setVersion('1.0.3');
584 
585  $input = [$foo1, $foo2, $bar1, $bar2, $bar3];
586  $this->assertEquals(['foo' => $foo2, 'bar' => $bar1], (new ‪DependencyUtility())->filterYoungestVersionOfExtensionList($input, true));
587  }
588 
593  {
594  $suitableDependency = new ‪Dependency();
595  $suitableDependency->setIdentifier('typo3');
596  $suitableDependency->setLowestVersion('3.6.1');
597 
598  $suitableDependencies = new \SplObjectStorage();
599  $suitableDependencies->attach($suitableDependency);
600 
601  $unsuitableDependency = new ‪Dependency();
602  $unsuitableDependency->setIdentifier('typo3');
603  $unsuitableDependency->setHighestVersion('4.3.0');
604 
605  $unsuitableDependencies = new \SplObjectStorage();
606  $unsuitableDependencies->attach($unsuitableDependency);
607 
608  // foo1 should be kept
609  $foo1 = new ‪Extension();
610  $foo1->setExtensionKey('foo');
611  $foo1->setVersion('1.0.0');
612  $foo1->setDependencies($suitableDependencies);
613 
614  $foo2 = new ‪Extension();
615  $foo2->setExtensionKey('foo');
616  $foo2->setVersion('1.0.1');
617  $foo2->setDependencies($unsuitableDependencies);
618 
619  // bar2 should be kept
620  $bar1 = new ‪Extension();
621  $bar1->setExtensionKey('bar');
622  $bar1->setVersion('1.1.2');
623  $bar1->setDependencies($unsuitableDependencies);
624 
625  $bar2 = new ‪Extension();
626  $bar2->setExtensionKey('bar');
627  $bar2->setVersion('1.1.1');
628  $bar2->setDependencies($suitableDependencies);
629 
630  $input = [$foo1, $foo2, $bar1, $bar2];
631  $this->assertEquals(['foo' => $foo1, 'bar' => $bar2], (new ‪DependencyUtility())->filterYoungestVersionOfExtensionList($input, false));
632  }
633 }
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\checkPhpDependencyThrowsExceptionIfVersionNumberIsTooHigh
‪checkPhpDependencyThrowsExceptionIfVersionNumberIsTooHigh()
Definition: DependencyUtilityTest.php:167
‪TYPO3\CMS\Extensionmanager\Domain\Model\Dependency
Definition: Dependency.php:22
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\checkTypo3DependencyCanHandleEmptyVersionHighestVersion
‪checkTypo3DependencyCanHandleEmptyVersionHighestVersion()
Definition: DependencyUtilityTest.php:115
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\checkTypo3DependencyThrowsExceptionIfIdentifierIsNotTypo3
‪checkTypo3DependencyThrowsExceptionIfIdentifierIsNotTypo3()
Definition: DependencyUtilityTest.php:81
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\isDownloadableVersionCompatibleReturnsTrueIfCompatibleVersionExists
‪isDownloadableVersionCompatibleReturnsTrueIfCompatibleVersionExists()
Definition: DependencyUtilityTest.php:441
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\checkTypo3DependencyThrowsExceptionIfVersionNumberIsTooHigh
‪checkTypo3DependencyThrowsExceptionIfVersionNumberIsTooHigh()
Definition: DependencyUtilityTest.php:62
‪TYPO3\CMS\Extbase\Annotation
Definition: IgnoreValidation.php:4
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\isExtensionDownloadableFromTerReturnsFalseIfNoVersionExists
‪isExtensionDownloadableFromTerReturnsFalseIfNoVersionExists()
Definition: DependencyUtilityTest.php:424
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\isVersionCompatibleReturnsTrueForCompatibleVersion
‪isVersionCompatibleReturnsTrueForCompatibleVersion()
Definition: DependencyUtilityTest.php:305
‪TYPO3\CMS\Extensionmanager\Domain\Model\Extension
Definition: Extension.php:24
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\checkTypo3DependencyCanHandleEmptyVersionLowestVersion
‪checkTypo3DependencyCanHandleEmptyVersionLowestVersion()
Definition: DependencyUtilityTest.php:132
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\isExtensionDownloadableFromTerReturnsTrueIfOneVersionExists
‪isExtensionDownloadableFromTerReturnsTrueIfOneVersionExists()
Definition: DependencyUtilityTest.php:407
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\isAvailableVersionCompatibleCallsIsVersionCompatibleWithExtensionVersion
‪isAvailableVersionCompatibleCallsIsVersionCompatibleWithExtensionVersion()
Definition: DependencyUtilityTest.php:379
‪TYPO3
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility
Definition: DependencyUtilityTest.php:2
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\checkPhpDependencyReturnsTrueIfVersionNumberIsInRange
‪checkPhpDependencyReturnsTrueIfVersionNumberIsInRange()
Definition: DependencyUtilityTest.php:203
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\checkPhpDependencyCanHandleEmptyVersionLowestVersion
‪checkPhpDependencyCanHandleEmptyVersionLowestVersion()
Definition: DependencyUtilityTest.php:237
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\isDownloadableVersionCompatibleReturnsFalseIfIncompatibleVersionExists
‪isDownloadableVersionCompatibleReturnsFalseIfIncompatibleVersionExists()
Definition: DependencyUtilityTest.php:464
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\isDependentExtensionAvailableReturnsTrueIfExtensionIsAvailable
‪isDependentExtensionAvailableReturnsTrueIfExtensionIsAvailable()
Definition: DependencyUtilityTest.php:339
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\$objectManagerMock
‪TYPO3 CMS Extbase Object ObjectManagerInterface $objectManagerMock
Definition: DependencyUtilityTest.php:31
‪TYPO3\CMS\Extensionmanager\Utility\DependencyUtility
Definition: DependencyUtility.php:28
‪TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository
Definition: ExtensionRepository.php:27
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\checkDependenciesCallsMethodToCheckPhpDependencies
‪checkDependenciesCallsMethodToCheckPhpDependencies()
Definition: DependencyUtilityTest.php:254
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest
Definition: DependencyUtilityTest.php:28
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\filterYoungestVersionOfExtensionListFiltersAListToLatestVersionWithOnlyCompatibleExtensions
‪filterYoungestVersionOfExtensionListFiltersAListToLatestVersionWithOnlyCompatibleExtensions()
Definition: DependencyUtilityTest.php:591
‪TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
Definition: ExtensionManagerException.php:23
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\setUp
‪setUp()
Definition: DependencyUtilityTest.php:36
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\checkTypo3DependencyReturnsTrueIfVersionNumberIsInRange
‪checkTypo3DependencyReturnsTrueIfVersionNumberIsInRange()
Definition: DependencyUtilityTest.php:98
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\checkPhpDependencyThrowsExceptionIfIdentifierIsNotTypo3
‪checkPhpDependencyThrowsExceptionIfIdentifierIsNotTypo3()
Definition: DependencyUtilityTest.php:186
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\filterYoungestVersionOfExtensionListFiltersAListToLatestVersion
‪filterYoungestVersionOfExtensionListFiltersAListToLatestVersion()
Definition: DependencyUtilityTest.php:563
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\checkTypo3DependencyThrowsExceptionIfVersionNumberIsTooLow
‪checkTypo3DependencyThrowsExceptionIfVersionNumberIsTooLow()
Definition: DependencyUtilityTest.php:44
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\checkPhpDependencyThrowsExceptionIfVersionNumberIsTooLow
‪checkPhpDependencyThrowsExceptionIfVersionNumberIsTooLow()
Definition: DependencyUtilityTest.php:149
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\checkDependenciesCallsMethodToCheckTypo3Dependencies
‪checkDependenciesCallsMethodToCheckTypo3Dependencies()
Definition: DependencyUtilityTest.php:279
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\checkPhpDependencyCanHandleEmptyVersionHighestVersion
‪checkPhpDependencyCanHandleEmptyVersionHighestVersion()
Definition: DependencyUtilityTest.php:220
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\isVersionCompatibleReturnsFalseForIncompatibleVersion
‪isVersionCompatibleReturnsFalseForIncompatibleVersion()
Definition: DependencyUtilityTest.php:322
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\isDependentExtensionAvailableReturnsFalseIfExtensionIsNotAvailable
‪isDependentExtensionAvailableReturnsFalseIfExtensionIsNotAvailable()
Definition: DependencyUtilityTest.php:359
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\getLowestAndHighestIntegerVersionsReturnsArrayWithVersions
‪getLowestAndHighestIntegerVersionsReturnsArrayWithVersions()
Definition: DependencyUtilityTest.php:489
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\DependencyUtilityTest\getLatestCompatibleExtensionByIntegerVersionDependencyWillReturnExtensionModelOfLatestExtension
‪getLatestCompatibleExtensionByIntegerVersionDependencyWillReturnExtensionModelOfLatestExtension()
Definition: DependencyUtilityTest.php:510