‪TYPO3CMS  10.4
PackageManagerTest.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 
20 use org\bovigo\vfs\vfsStream;
28 use TYPO3\CMS\Core\Package\PackageManager;
31 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
32 
36 class ‪PackageManagerTest extends UnitTestCase
37 {
41  protected ‪$packageManager;
42 
46  protected function ‪setUp(): void
47  {
48  parent::setUp();
49  vfsStream::setup('Test');
50 
52  $mockCache = $this->getMockBuilder(PhpFrontend::class)
53  ->setMethods(['has', 'set', 'getBackend'])
54  ->disableOriginalConstructor()
55  ->getMock();
56  $mockCacheBackend = $this->getMockBuilder(SimpleFileBackend::class)
57  ->setMethods(['has', 'set', 'getBackend', 'getCacheDirectory'])
58  ->disableOriginalConstructor()
59  ->getMock();
60  $mockCache->expects(self::any())->method('has')->willReturn(false);
61  $mockCache->expects(self::any())->method('set')->willReturn(true);
62  $mockCache->expects(self::any())->method('getBackend')->willReturn($mockCacheBackend);
63  $mockCacheBackend->expects(self::any())->method('getCacheDirectory')->willReturn('vfs://Test/Cache');
64  $this->packageManager = $this->getAccessibleMock(
65  PackageManager::class,
66  ['sortAndSavePackageStates', 'sortActivePackagesByDependencies', 'registerTransientClassLoadingInformationForPackage'],
68  );
69 
70  mkdir('vfs://Test/Packages/Application', 0700, true);
71  mkdir('vfs://Test/Configuration');
72  file_put_contents('vfs://Test/Configuration/PackageStates.php', "<?php return array ('packages' => array(), 'version' => 5); ");
73 
74  $composerNameToPackageKeyMap = [
75  'typo3/flow' => 'TYPO3.Flow'
76  ];
77 
78  $this->packageManager->injectCoreCache($mockCache);
79  $this->packageManager->_set('composerNameToPackageKeyMap', $composerNameToPackageKeyMap);
80  $this->packageManager->_set('packagesBasePath', 'vfs://Test/Packages/');
81  $this->packageManager->_set('packageStatesPathAndFilename', 'vfs://Test/Configuration/PackageStates.php');
82  }
83 
89  protected function ‪createPackage(string $packageKey): ‪Package
90  {
91  $packagePath = 'vfs://Test/Packages/Application/' . $packageKey . '/';
92  mkdir($packagePath, 0770, true);
93  file_put_contents($packagePath . 'ext_emconf.php', '<?php' . LF . '$EM_CONF[$_EXTKEY] = [];');
94  file_put_contents($packagePath . 'composer.json', '{}');
95  $package = new ‪Package($this->packageManager, $packageKey, $packagePath);
96  $this->packageManager->registerPackage($package);
97  $this->packageManager->activatePackage($packageKey);
98 
99  return $package;
100  }
101 
107  public function ‪getPackageReturnsTheSpecifiedPackage(): void
108  {
109  $this->‪createPackage('TYPO3.MyPackage');
110  $package = $this->packageManager->getPackage('TYPO3.MyPackage');
111 
112  self::assertInstanceOf(Package::class, $package, 'The result of getPackage() was no valid package object.');
113  }
114 
119  public function ‪getPackageThrowsExceptionOnUnknownPackage(): void
120  {
121  $this->expectException(UnknownPackageException::class);
122  $this->expectExceptionCode(1166546734);
123 
124  $this->packageManager->getPackage('PrettyUnlikelyThatThisPackageExists');
125  }
126 
131  {
132  $expectedPackageKeys = [
133  ‪StringUtility::getUniqueId('TYPO3.CMS'),
134  ‪StringUtility::getUniqueId('TYPO3.CMS.Test'),
135  ‪StringUtility::getUniqueId('TYPO3.YetAnotherTestPackage'),
136  ‪StringUtility::getUniqueId('Lolli.Pop.NothingElse')
137  ];
138 
139  foreach ($expectedPackageKeys as $packageKey) {
140  $packagePath = 'vfs://Test/Packages/Application/' . $packageKey . '/';
141 
142  mkdir($packagePath, 0770, true);
143  file_put_contents($packagePath . 'composer.json', '{"name": "' . $packageKey . '", "type": "typo3-test"}');
144  }
145 
146  ‪$packageManager = $this->getAccessibleMock(PackageManager::class, ['sortAndSavePackageStates'], [new ‪DependencyOrderingService()]);
147  ‪$packageManager->_set('packagesBasePath', 'vfs://Test/Packages/');
148  ‪$packageManager->_set('packageStatesPathAndFilename', 'vfs://Test/Configuration/PackageStates.php');
149 
150  ‪$packageManager->_set('packages', []);
151  ‪$packageManager->_call('scanAvailablePackages');
152 
153  $packageStates = require 'vfs://Test/Configuration/PackageStates.php';
154  $actualPackageKeys = array_keys($packageStates['packages']);
155  self::assertEquals(sort($expectedPackageKeys), sort($actualPackageKeys));
156  }
157 
162  {
163  $expectedPackageKeys = [
164  ‪StringUtility::getUniqueId('TYPO3.CMS'),
165  ‪StringUtility::getUniqueId('TYPO3.CMS.Test'),
166  ‪StringUtility::getUniqueId('TYPO3.YetAnotherTestPackage'),
167  ‪StringUtility::getUniqueId('Lolli.Pop.NothingElse')
168  ];
169 
170  $packagePaths = [];
171  foreach ($expectedPackageKeys as $packageKey) {
172  $packagePath = 'vfs://Test/Packages/Application/' . $packageKey . '/';
173  $packagePaths[] = $packagePath;
174 
175  mkdir($packagePath, 0770, true);
176  file_put_contents($packagePath . 'composer.json', '{"name": "' . $packageKey . '", "type": "typo3-cms-test"}');
177  file_put_contents($packagePath . 'ext_emconf.php', '<?php' . LF . '$EM_CONF[$_EXTKEY] = [];');
178  }
179 
181  ‪$packageManager = $this->getAccessibleMock(PackageManager::class, ['dummy'], [new ‪DependencyOrderingService()]);
182  ‪$packageManager->_set('packagesBasePaths', $packagePaths);
183  ‪$packageManager->_set('packagesBasePath', 'vfs://Test/Packages/');
184  ‪$packageManager->_set('packageStatesPathAndFilename', 'vfs://Test/Configuration/PackageStates.php');
185 
186  $packageKey = $expectedPackageKeys[0];
187  ‪$packageManager->_set('packageStatesConfiguration', [
188  'packages' => [
189  $packageKey => [
190  'packagePath' => 'Application/' . $packageKey . '/'
191  ]
192  ],
193  'version' => 5
194  ]);
195  ‪$packageManager->_call('scanAvailablePackages');
196  ‪$packageManager->_call('sortAndSavePackageStates');
197 
198  $packageStates = require 'vfs://Test/Configuration/PackageStates.php';
199  self::assertEquals('Application/' . $packageKey . '/', $packageStates['packages'][$packageKey]['packagePath']);
200  }
201 
206  {
207  $packageKeys = [
208  ‪StringUtility::getUniqueId('Lolli.Pop.NothingElse'),
209  ‪StringUtility::getUniqueId('TYPO3.Package'),
210  ‪StringUtility::getUniqueId('TYPO3.YetAnotherTestPackage')
211  ];
212 
213  $packagePaths = [];
214  foreach ($packageKeys as $packageKey) {
215  $packagePath = 'vfs://Test/Packages/Application/' . $packageKey . '/';
216 
217  mkdir($packagePath, 0770, true);
218  file_put_contents($packagePath . 'composer.json', '{"name": "' . $packageKey . '", "type": "typo3-cms-test"}');
219  file_put_contents($packagePath . 'ext_emconf.php', '<?php' . LF . '$EM_CONF[$_EXTKEY] = [];');
220  $packagePaths[] = $packagePath;
221  }
222 
224  ‪$packageManager = $this->getAccessibleMock(PackageManager::class, ['sortAndSavePackageStates', 'registerTransientClassLoadingInformationForPackage'], [new ‪DependencyOrderingService()]);
225  ‪$packageManager->_set('packagesBasePaths', $packagePaths);
226  ‪$packageManager->_set('packagesBasePath', 'vfs://Test/Packages/');
227  ‪$packageManager->_set('packageStatesPathAndFilename', 'vfs://Test/Configuration/PackageStates.php');
228 
229  ‪$packageManager->_set('packages', []);
230  ‪$packageManager->_call('scanAvailablePackages');
231 
232  $expectedPackageStatesConfiguration = [];
233  foreach ($packageKeys as $packageKey) {
234  $expectedPackageStatesConfiguration[$packageKey] = [
235  'packagePath' => 'Application/' . $packageKey . '/'
236  ];
237  ‪$packageManager->activatePackage($packageKey);
238  }
239 
240  $actualPackageStatesConfiguration = ‪$packageManager->_get('packageStatesConfiguration');
241  self::assertEquals($expectedPackageStatesConfiguration, $actualPackageStatesConfiguration['packages']);
242  }
243 
249  public function ‪packageKeysAndPaths(): array
250  {
251  return [
252  ['TYPO3.YetAnotherTestPackage', 'vfs://Test/Packages/Application/TYPO3.YetAnotherTestPackage/'],
253  ['Lolli.Pop.NothingElse', 'vfs://Test/Packages/Application/Lolli.Pop.NothingElse/']
254  ];
255  }
256 
262  public function ‪createPackageCreatesPackageFolderAndReturnsPackage($packageKey, $expectedPackagePath): void
263  {
264  $actualPackage = $this->‪createPackage($packageKey);
265  $actualPackagePath = $actualPackage->getPackagePath();
266 
267  self::assertEquals($expectedPackagePath, $actualPackagePath);
268  self::assertTrue(is_dir($actualPackagePath), 'Package path should exist after createPackage()');
269  self::assertEquals($packageKey, $actualPackage->getPackageKey());
270  self::assertTrue($this->packageManager->isPackageAvailable($packageKey));
271  }
272 
281  {
282  $packageKey = 'Acme.YetAnotherTestPackage';
283 
284  $this->‪createPackage($packageKey);
285 
286  $this->packageManager->expects(self::any())->method('sortActivePackagesByDependencies')->willReturn([]);
287 
288  $this->packageManager->deactivatePackage($packageKey);
289  self::assertFalse($this->packageManager->isPackageActive($packageKey));
290 
291  $this->packageManager->activatePackage($packageKey);
292  self::assertTrue($this->packageManager->isPackageActive($packageKey));
293  }
294 
303  {
304  $this->expectException(ProtectedPackageKeyException::class);
305  $this->expectExceptionCode(1308662891);
306 
307  $package = $this->‪createPackage('Acme.YetAnotherTestPackage');
308  $package->setProtected(true);
309  $this->packageManager->expects(self::any())->method('sortActivePackagesByDependencies')->willReturn([]);
310  $this->packageManager->deactivatePackage('Acme.YetAnotherTestPackage');
311  }
312 
320  {
321  $this->expectException(UnknownPackageException::class);
322  $this->expectExceptionCode(1166543253);
323 
324  $this->packageManager->expects(self::any())->method('sortActivePackagesByDependencies')->willReturn([]);
325  $this->packageManager->deletePackage('PrettyUnlikelyThatThisPackageExists');
326  }
327 
336  {
337  $this->expectException(ProtectedPackageKeyException::class);
338  $this->expectExceptionCode(1220722120);
339 
340  $package = $this->‪createPackage('Acme.YetAnotherTestPackage');
341  $package->setProtected(true);
342  $this->packageManager->deletePackage('Acme.YetAnotherTestPackage');
343  }
344 
353  {
354  $this->‪createPackage('Acme.YetAnotherTestPackage');
355 
356  $this->packageManager->expects(self::any())->method('sortActivePackagesByDependencies')->willReturn([]);
357 
358  self::assertTrue($this->packageManager->isPackageActive('Acme.YetAnotherTestPackage'));
359  self::assertTrue($this->packageManager->isPackageAvailable('Acme.YetAnotherTestPackage'));
360 
361  $this->packageManager->deletePackage('Acme.YetAnotherTestPackage');
362 
363  self::assertFalse($this->packageManager->isPackageActive('Acme.YetAnotherTestPackage'));
364  self::assertFalse($this->packageManager->isPackageAvailable('Acme.YetAnotherTestPackage'));
365  }
366 
370  public function ‪composerNamesAndPackageKeys(): array
371  {
372  return [
373  ['imagine/Imagine', 'imagine.Imagine'],
374  ['imagine/imagine', 'imagine.Imagine'],
375  ['typo3/cms', 'TYPO3.CMS'],
376  ['TYPO3/CMS', 'TYPO3.CMS']
377  ];
378  }
379 
386  public function ‪getPackageKeyFromComposerNameIgnoresCaseDifferences(string $composerName, string $packageKey): void
387  {
388  $packageStatesConfiguration = [
389  'packages' => [
390  'TYPO3.CMS',
391  'imagine.Imagine'
392  ]
393  ];
394  $composerNameToPackageKeyMap = [
395  'typo3/cms' => 'TYPO3.CMS',
396  'imagine/imagine' => 'imagine.Imagine'
397  ];
398 
399  ‪$packageManager = $this->getAccessibleMock(PackageManager::class, ['resolvePackageDependencies'], [new ‪DependencyOrderingService()]);
400  ‪$packageManager->_set('packageStatesConfiguration', $packageStatesConfiguration);
401  ‪$packageManager->_set('composerNameToPackageKeyMap', $composerNameToPackageKeyMap);
402 
403  self::assertEquals($packageKey, ‪$packageManager->_call('getPackageKeyFromComposerName', $composerName));
404  }
405 
410  {
411  return [
412  'TYPO3 Flow Packages' => [
413  [
414  'TYPO3.Flow' => [
415  'dependencies' => ['Symfony.Component.Yaml', 'Doctrine.Common', 'Doctrine.DBAL', 'Doctrine.ORM']
416  ],
417  'Doctrine.ORM' => [
418  'dependencies' => ['Doctrine.Common', 'Doctrine.DBAL']
419  ],
420  'Doctrine.Common' => [
421  'dependencies' => []
422  ],
423  'Doctrine.DBAL' => [
424  'dependencies' => ['Doctrine.Common']
425  ],
426  'Symfony.Component.Yaml' => [
427  'dependencies' => []
428  ],
429  ],
430  [
431  'Doctrine.Common'
432  ],
433  [
434  'TYPO3.Flow' => [
435  'TYPO3.Flow' => false,
436  'Doctrine.ORM' => true,
437  'Doctrine.Common' => true,
438  'Doctrine.DBAL' => true,
439  'Symfony.Component.Yaml' => true,
440  ],
441  'Doctrine.ORM' => [
442  'TYPO3.Flow' => false,
443  'Doctrine.ORM' => false,
444  'Doctrine.Common' => true,
445  'Doctrine.DBAL' => true,
446  'Symfony.Component.Yaml' => false,
447  ],
448  'Doctrine.Common' => [
449  'TYPO3.Flow' => false,
450  'Doctrine.ORM' => false,
451  'Doctrine.Common' => false,
452  'Doctrine.DBAL' => false,
453  'Symfony.Component.Yaml' => false,
454  ],
455  'Doctrine.DBAL' => [
456  'TYPO3.Flow' => false,
457  'Doctrine.ORM' => false,
458  'Doctrine.Common' => true,
459  'Doctrine.DBAL' => false,
460  'Symfony.Component.Yaml' => false,
461  ],
462  'Symfony.Component.Yaml' => [
463  'TYPO3.Flow' => false,
464  'Doctrine.ORM' => false,
465  'Doctrine.Common' => true,
466  'Doctrine.DBAL' => false,
467  'Symfony.Component.Yaml' => false,
468  ],
469  ],
470  ],
471  'TYPO3 CMS Extensions' => [
472  [
473  'core' => [
474  'dependencies' => [],
475  ],
476  'setup' => [
477  'dependencies' => ['core'],
478  ],
479  'openid' => [
480  'dependencies' => ['core', 'setup']
481  ],
482  'news' => [
483  'dependencies' => ['extbase'],
484  ],
485  'extbase' => [
486  'dependencies' => ['core'],
487  ],
488  'pt_extbase' => [
489  'dependencies' => ['extbase'],
490  ],
491  'foo' => [
492  'dependencies' => [],
493  ],
494  ],
495  [
496  'core',
497  'setup',
498  'openid',
499  'extbase'
500  ],
501  [
502  'core' => [
503  'core' => false,
504  'setup' => false,
505  'openid' => false,
506  'news' => false,
507  'extbase' => false,
508  'pt_extbase' => false,
509  'foo' => false
510  ],
511  'setup' => [
512  'core' => true,
513  'setup' => false,
514  'openid' => false,
515  'news' => false,
516  'extbase' => false,
517  'pt_extbase' => false,
518  'foo' => false
519  ],
520  'openid' => [
521  'core' => true,
522  'setup' => true,
523  'openid' => false,
524  'news' => false,
525  'extbase' => false,
526  'pt_extbase' => false,
527  'foo' => false
528  ],
529  'news' => [
530  'core' => false,
531  'setup' => false,
532  'openid' => true,
533  'news' => false,
534  'extbase' => true,
535  'pt_extbase' => false,
536  'foo' => false
537  ],
538  'extbase' => [
539  'core' => true,
540  'setup' => false,
541  'openid' => false,
542  'news' => false,
543  'extbase' => false,
544  'pt_extbase' => false,
545  'foo' => false
546  ],
547  'pt_extbase' => [
548  'core' => false,
549  'setup' => false,
550  'openid' => true,
551  'news' => false,
552  'extbase' => true,
553  'pt_extbase' => false,
554  'foo' => false
555  ],
556  'foo' => [
557  'core' => false,
558  'setup' => false,
559  'openid' => true,
560  'news' => false,
561  'extbase' => true,
562  'pt_extbase' => false,
563  'foo' => false
564  ],
565  ],
566  ],
567  'Dummy Packages' => [
568  [
569  'A' => [
570  'dependencies' => ['B', 'D', 'C'],
571  ],
572  'B' => [
573  'dependencies' => []
574  ],
575  'C' => [
576  'dependencies' => ['E']
577  ],
578  'D' => [
579  'dependencies' => ['E'],
580  ],
581  'E' => [
582  'dependencies' => [],
583  ],
584  'F' => [
585  'dependencies' => [],
586  ],
587  ],
588  [
589  'B',
590  'C',
591  'E'
592  ],
593  [
594  'A' => [
595  'A' => false,
596  'B' => true,
597  'C' => true,
598  'D' => true,
599  'E' => false,
600  'F' => false,
601  ],
602  'B' => [
603  'A' => false,
604  'B' => false,
605  'C' => false,
606  'D' => false,
607  'E' => false,
608  'F' => false,
609  ],
610  'C' => [
611  'A' => false,
612  'B' => false,
613  'C' => false,
614  'D' => false,
615  'E' => true,
616  'F' => false,
617  ],
618  'D' => [
619  'A' => false,
620  'B' => true,
621  'C' => true,
622  'D' => false,
623  'E' => false,
624  'F' => false,
625  ],
626  'E' => [
627  'A' => false,
628  'B' => false,
629  'C' => false,
630  'D' => false,
631  'E' => false,
632  'F' => false,
633  ],
634  'F' => [
635  'A' => false,
636  'B' => true,
637  'C' => true,
638  'D' => false,
639  'E' => false,
640  'F' => false,
641  ],
642  ],
643  ],
644  ];
645  }
646 
654  public function ‪buildDependencyGraphBuildsCorrectGraph(array $unsortedPackageStatesConfiguration, array $frameworkPackageKeys, array $expectedGraph): void
655  {
656  ‪$packageManager = $this->getAccessibleMock(PackageManager::class, ['findFrameworkPackages'], [new ‪DependencyOrderingService()]);
657  ‪$packageManager->expects(self::any())->method('findFrameworkPackages')->willReturn($frameworkPackageKeys);
658 
659  $dependencyGraph = ‪$packageManager->_call('buildDependencyGraph', $unsortedPackageStatesConfiguration);
660 
661  self::assertEquals($expectedGraph, $dependencyGraph);
662  }
663 
667  public function ‪packageSortingDataProvider(): array
668  {
669  return [
670  'TYPO3 Flow Packages' => [
671  [
672  'TYPO3.Flow' => [
673  'dependencies' => ['Symfony.Component.Yaml', 'Doctrine.Common', 'Doctrine.DBAL', 'Doctrine.ORM']
674  ],
675  'Doctrine.ORM' => [
676  'dependencies' => ['Doctrine.Common', 'Doctrine.DBAL']
677  ],
678  'Doctrine.Common' => [
679  'dependencies' => []
680  ],
681  'Doctrine.DBAL' => [
682  'dependencies' => ['Doctrine.Common']
683  ],
684  'Symfony.Component.Yaml' => [
685  'dependencies' => []
686  ],
687  ],
688  [
689  'Doctrine.Common'
690  ],
691  [
692  'Doctrine.Common',
693  'Doctrine.DBAL',
694  'Doctrine.ORM',
695  'Symfony.Component.Yaml',
696  'TYPO3.Flow',
697  ],
698  ],
699  'TYPO3 CMS Extensions' => [
700  [
701  'core' => [
702  'dependencies' => [],
703  ],
704  'setup' => [
705  'dependencies' => ['core'],
706  ],
707  'openid' => [
708  'dependencies' => ['core', 'setup']
709  ],
710  'news' => [
711  'dependencies' => ['extbase'],
712  ],
713  'extbase' => [
714  'dependencies' => ['core'],
715  ],
716  'pt_extbase' => [
717  'dependencies' => ['extbase'],
718  ],
719  'foo' => [
720  'dependencies' => [],
721  ],
722  ],
723  [
724  'core',
725  'setup',
726  'openid',
727  'extbase'
728  ],
729  [
730  'core',
731  'setup',
732  'openid',
733  'extbase',
734  'foo',
735  'news',
736  'pt_extbase',
737  ],
738  ],
739  'Dummy Packages' => [
740  [
741  'A' => [
742  'dependencies' => ['B', 'D', 'C'],
743  ],
744  'B' => [
745  'dependencies' => []
746  ],
747  'C' => [
748  'dependencies' => ['E']
749  ],
750  'D' => [
751  'dependencies' => ['E'],
752  ],
753  'E' => [
754  'dependencies' => [],
755  ],
756  'F' => [
757  'dependencies' => [],
758  ],
759  ],
760  [
761  'B',
762  'C',
763  'E'
764  ],
765  [
766  'E',
767  'C',
768  'B',
769  'D',
770  'A',
771  'F',
772  ],
773  ],
774  ];
775  }
776 
783  public function ‪sortPackageStatesConfigurationByDependencyMakesSureThatDependantPackagesAreStandingBeforeAPackageInTheInternalPackagesAndPackagesConfigurationArrays($unsortedPackageStatesConfiguration, $frameworkPackageKeys, $expectedSortedPackageKeys): void
784  {
785  ‪$packageManager = $this->getAccessibleMock(PackageManager::class, ['findFrameworkPackages'], [new ‪DependencyOrderingService()]);
786  ‪$packageManager->expects(self::any())->method('findFrameworkPackages')->willReturn($frameworkPackageKeys);
787 
788  $sortedPackageKeys = ‪$packageManager->_call('sortPackageStatesConfigurationByDependency', $unsortedPackageStatesConfiguration);
789 
790  self::assertEquals($expectedSortedPackageKeys, $sortedPackageKeys, 'The package states configurations have not been ordered according to their dependencies!');
791  }
792 
797  {
798  $unsortedPackageStatesConfiguration = [
799  'A' => [
800  'dependencies' => ['B'],
801  ],
802  'B' => [
803  'dependencies' => ['A']
804  ],
805  ];
806 
807  $this->expectException(\UnexpectedValueException::class);
808  $this->expectExceptionCode(1381960494);
809 
810  ‪$packageManager = $this->getAccessibleMock(PackageManager::class, ['findFrameworkPackages'], [new ‪DependencyOrderingService()]);
811  ‪$packageManager->expects(self::any())->method('findFrameworkPackages')->willReturn([]);
812 
813  ‪$packageManager->_call('sortPackageStatesConfigurationByDependency', $unsortedPackageStatesConfiguration);
814  }
815 }
‪TYPO3\CMS\Core\Tests\Unit\Package\PackageManagerTest\scanAvailablePackagesTraversesThePackagesDirectoryAndRegistersPackagesItFinds
‪scanAvailablePackagesTraversesThePackagesDirectoryAndRegistersPackagesItFinds()
Definition: PackageManagerTest.php:129
‪TYPO3\CMS\Core\Package\Exception\UnknownPackageException
Definition: UnknownPackageException.php:24
‪TYPO3\CMS\Core\Package\Exception\PackageStatesFileNotWritableException
Definition: PackageStatesFileNotWritableException.php:24
‪TYPO3\CMS\Core\Tests\Unit\Package\composerNamesAndPackageKeys
‪array composerNamesAndPackageKeys()
Definition: PackageManagerTest.php:369
‪TYPO3\CMS\Core\Tests\Unit\Package\getPackageKeyFromComposerNameIgnoresCaseDifferences
‪getPackageKeyFromComposerNameIgnoresCaseDifferences(string $composerName, string $packageKey)
Definition: PackageManagerTest.php:385
‪TYPO3\CMS\Core\Tests\Unit\Package\deletePackageThrowsAnExceptionIfPackageIsProtected
‪deletePackageThrowsAnExceptionIfPackageIsProtected()
Definition: PackageManagerTest.php:334
‪TYPO3\CMS\Core\Tests\Unit\Package\scanAvailablePackagesKeepsExistingPackageConfiguration
‪scanAvailablePackagesKeepsExistingPackageConfiguration()
Definition: PackageManagerTest.php:160
‪TYPO3\CMS\Core\Tests\Unit\Package\PackageManagerTest\$packageManager
‪PackageManager PHPUnit Framework MockObject MockObject TYPO3 TestingFramework Core AccessibleObjectInterface $packageManager
Definition: PackageManagerTest.php:40
‪TYPO3\CMS\Core\Tests\Unit\Package\sortPackageStatesConfigurationByDependencyMakesSureThatDependantPackagesAreStandingBeforeAPackageInTheInternalPackagesAndPackagesConfigurationArrays
‪sortPackageStatesConfigurationByDependencyMakesSureThatDependantPackagesAreStandingBeforeAPackageInTheInternalPackagesAndPackagesConfigurationArrays($unsortedPackageStatesConfiguration, $frameworkPackageKeys, $expectedSortedPackageKeys)
Definition: PackageManagerTest.php:782
‪TYPO3\CMS\Core\Cache\Frontend\PhpFrontend
Definition: PhpFrontend.php:25
‪TYPO3\CMS\Core\Tests\Unit\Package\PackageManagerTest\getPackageThrowsExceptionOnUnknownPackage
‪getPackageThrowsExceptionOnUnknownPackage()
Definition: PackageManagerTest.php:118
‪TYPO3\CMS\Core\Tests\Unit\Package\deactivatePackageThrowsAnExceptionIfPackageIsProtected
‪deactivatePackageThrowsAnExceptionIfPackageIsProtected()
Definition: PackageManagerTest.php:301
‪TYPO3\CMS\Core\Tests\Unit\Package\deletePackageRemovesPackageFromAvailableAndActivePackagesAndDeletesThePackageDirectory
‪deletePackageRemovesPackageFromAvailableAndActivePackagesAndDeletesThePackageDirectory()
Definition: PackageManagerTest.php:351
‪TYPO3\CMS\Core\Tests\Unit\Package\packageSortingDataProvider
‪array packageSortingDataProvider()
Definition: PackageManagerTest.php:666
‪TYPO3\CMS\Core\Tests\Unit\Package\PackageManagerTest\getPackageReturnsTheSpecifiedPackage
‪getPackageReturnsTheSpecifiedPackage()
Definition: PackageManagerTest.php:106
‪TYPO3\CMS\Core\Tests\Unit\Package\PackageManagerTest
Definition: PackageManagerTest.php:37
‪TYPO3\CMS\Core\Tests\Unit\Package\sortPackageStatesConfigurationByDependencyThrowsExceptionWhenCycleDetected
‪sortPackageStatesConfigurationByDependencyThrowsExceptionWhenCycleDetected()
Definition: PackageManagerTest.php:795
‪TYPO3\CMS\Core\Tests\Unit\Package
Definition: AbstractServiceProviderTest.php:18
‪TYPO3\CMS\Core\Tests\Unit\Package\createPackageCreatesPackageFolderAndReturnsPackage
‪createPackageCreatesPackageFolderAndReturnsPackage($packageKey, $expectedPackagePath)
Definition: PackageManagerTest.php:261
‪TYPO3\CMS\Core\Tests\Unit\Package\activatePackageAndDeactivatePackageActivateAndDeactivateTheGivenPackage
‪activatePackageAndDeactivatePackageActivateAndDeactivateTheGivenPackage()
Definition: PackageManagerTest.php:279
‪TYPO3\CMS\Core\Package\Package
Definition: Package.php:26
‪TYPO3\CMS\Core\Service\DependencyOrderingService
Definition: DependencyOrderingService.php:32
‪TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend
Definition: SimpleFileBackend.php:33
‪TYPO3\CMS\Core\Tests\Unit\Package\packageKeysAndPaths
‪array packageKeysAndPaths()
Definition: PackageManagerTest.php:248
‪TYPO3\CMS\Core\Utility\StringUtility\getUniqueId
‪static string getUniqueId($prefix='')
Definition: StringUtility.php:92
‪TYPO3\CMS\Core\Package\Exception\InvalidPackageStateException
Definition: InvalidPackageStateException.php:24
‪TYPO3\CMS\Core\Tests\Unit\Package\buildDependencyGraphBuildsCorrectGraphDataProvider
‪array buildDependencyGraphBuildsCorrectGraphDataProvider()
Definition: PackageManagerTest.php:408
‪TYPO3\CMS\Core\Tests\Unit\Package\PackageManagerTest\setUp
‪setUp()
Definition: PackageManagerTest.php:45
‪TYPO3\CMS\Core\Tests\Unit\Package\buildDependencyGraphBuildsCorrectGraph
‪buildDependencyGraphBuildsCorrectGraph(array $unsortedPackageStatesConfiguration, array $frameworkPackageKeys, array $expectedGraph)
Definition: PackageManagerTest.php:653
‪TYPO3\CMS\Core\Utility\StringUtility
Definition: StringUtility.php:22
‪TYPO3\CMS\Core\Package\Exception\ProtectedPackageKeyException
Definition: ProtectedPackageKeyException.php:24
‪TYPO3\CMS\Core\Tests\Unit\Package\packageStatesConfigurationContainsRelativePaths
‪packageStatesConfigurationContainsRelativePaths()
Definition: PackageManagerTest.php:204
‪TYPO3\CMS\Core\Tests\Unit\Package\deletePackageThrowsErrorIfPackageIsNotAvailable
‪deletePackageThrowsErrorIfPackageIsNotAvailable()
Definition: PackageManagerTest.php:318
‪TYPO3\CMS\Core\Tests\Unit\Package\PackageManagerTest\createPackage
‪Package createPackage(string $packageKey)
Definition: PackageManagerTest.php:88