‪TYPO3CMS  9.5
PackageManagerTest.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
4 
5 /* *
6  * This script belongs to the TYPO3 Flow framework. *
7  * *
8  * It is free software; you can redistribute it and/or modify it under *
9  * the terms of the GNU Lesser General Public License, either version 3 *
10  * of the License, or (at your option) any later version. *
11  * *
12  * The TYPO3 project - inspiring people to share! *
13  * */
14 
15 use org\bovigo\vfs\vfsStream;
23 use TYPO3\CMS\Core\Package\PackageManager;
25 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
26 
30 class ‪PackageManagerTest extends UnitTestCase
31 {
35  protected ‪$packageManager;
36 
40  protected function ‪setUp()
41  {
42  vfsStream::setup('Test');
43 
45  $mockCache = $this->getMockBuilder(PhpFrontend::class)
46  ->setMethods(['has', 'set', 'getBackend'])
47  ->disableOriginalConstructor()
48  ->getMock();
49  $mockCacheBackend = $this->getMockBuilder(SimpleFileBackend::class)
50  ->setMethods(['has', 'set', 'getBackend', 'getCacheDirectory'])
51  ->disableOriginalConstructor()
52  ->getMock();
53  $mockCache->expects($this->any())->method('has')->will($this->returnValue(false));
54  $mockCache->expects($this->any())->method('set')->will($this->returnValue(true));
55  $mockCache->expects($this->any())->method('getBackend')->will($this->returnValue($mockCacheBackend));
56  $mockCacheBackend->expects($this->any())->method('getCacheDirectory')->will($this->returnValue('vfs://Test/Cache'));
57  $this->packageManager = $this->getAccessibleMock(
58  PackageManager::class,
59  ['sortAndSavePackageStates', 'sortActivePackagesByDependencies', 'registerTransientClassLoadingInformationForPackage'],
61  );
62 
63  mkdir('vfs://Test/Packages/Application', 0700, true);
64  mkdir('vfs://Test/Configuration');
65  file_put_contents('vfs://Test/Configuration/PackageStates.php', "<?php return array ('packages' => array(), 'version' => 5); ");
66 
67  $composerNameToPackageKeyMap = [
68  'typo3/flow' => 'TYPO3.Flow'
69  ];
70 
71  $this->packageManager->injectCoreCache($mockCache);
72  $this->inject($this->packageManager, 'composerNameToPackageKeyMap', $composerNameToPackageKeyMap);
73  $this->packageManager->_set('packagesBasePath', 'vfs://Test/Packages/');
74  $this->packageManager->_set('packageStatesPathAndFilename', 'vfs://Test/Configuration/PackageStates.php');
75  }
76 
82  protected function ‪createPackage(string $packageKey): ‪Package
83  {
84  $packagePath = 'vfs://Test/Packages/Application/' . $packageKey . '/';
85  mkdir($packagePath, 0770, true);
86  file_put_contents($packagePath . 'ext_emconf.php', '<?php' . LF . '$EM_CONF[$_EXTKEY] = [];');
87  file_put_contents($packagePath . 'composer.json', '{}');
88  $package = new ‪Package($this->packageManager, $packageKey, $packagePath);
89  $this->packageManager->registerPackage($package);
90  $this->packageManager->activatePackage($packageKey);
91 
92  return $package;
93  }
94 
100  public function ‪getPackageReturnsTheSpecifiedPackage(): void
101  {
102  $this->‪createPackage('TYPO3.MyPackage');
103  $package = $this->packageManager->getPackage('TYPO3.MyPackage');
104 
105  $this->assertInstanceOf(Package::class, $package, 'The result of getPackage() was no valid package object.');
106  }
107 
112  public function ‪getPackageThrowsExceptionOnUnknownPackage(): void
113  {
114  $this->expectException(UnknownPackageException::class);
115  $this->expectExceptionCode(1166546734);
116 
117  $this->packageManager->getPackage('PrettyUnlikelyThatThisPackageExists');
118  }
119 
124  {
125  $expectedPackageKeys = [
126  $this->getUniqueId('TYPO3.CMS'),
127  $this->getUniqueId('TYPO3.CMS.Test'),
128  $this->getUniqueId('TYPO3.YetAnotherTestPackage'),
129  $this->getUniqueId('Lolli.Pop.NothingElse')
130  ];
131 
132  foreach ($expectedPackageKeys as $packageKey) {
133  $packagePath = 'vfs://Test/Packages/Application/' . $packageKey . '/';
134 
135  mkdir($packagePath, 0770, true);
136  file_put_contents($packagePath . 'composer.json', '{"name": "' . $packageKey . '", "type": "typo3-test"}');
137  }
138 
139  ‪$packageManager = $this->getAccessibleMock(PackageManager::class, ['sortAndSavePackageStates'], [new ‪DependencyOrderingService]);
140  ‪$packageManager->_set('packagesBasePath', 'vfs://Test/Packages/');
141  ‪$packageManager->_set('packageStatesPathAndFilename', 'vfs://Test/Configuration/PackageStates.php');
142 
143  ‪$packageManager->_set('packages', []);
144  ‪$packageManager->_call('scanAvailablePackages');
145 
146  $packageStates = require 'vfs://Test/Configuration/PackageStates.php';
147  $actualPackageKeys = array_keys($packageStates['packages']);
148  $this->assertEquals(sort($expectedPackageKeys), sort($actualPackageKeys));
149  }
150 
155  {
156  $expectedPackageKeys = [
157  $this->getUniqueId('TYPO3.CMS'),
158  $this->getUniqueId('TYPO3.CMS.Test'),
159  $this->getUniqueId('TYPO3.YetAnotherTestPackage'),
160  $this->getUniqueId('Lolli.Pop.NothingElse')
161  ];
162 
163  $packagePaths = [];
164  foreach ($expectedPackageKeys as $packageKey) {
165  $packagePath = 'vfs://Test/Packages/Application/' . $packageKey . '/';
166  $packagePaths[] = $packagePath;
167 
168  mkdir($packagePath, 0770, true);
169  file_put_contents($packagePath . 'composer.json', '{"name": "' . $packageKey . '", "type": "typo3-cms-test"}');
170  file_put_contents($packagePath . 'ext_emconf.php', '<?php' . LF . '$EM_CONF[$_EXTKEY] = [];');
171  }
172 
174  ‪$packageManager = $this->getAccessibleMock(PackageManager::class, ['dummy'], [new ‪DependencyOrderingService]);
175  ‪$packageManager->_set('packagesBasePaths', $packagePaths);
176  ‪$packageManager->_set('packagesBasePath', 'vfs://Test/Packages/');
177  ‪$packageManager->_set('packageStatesPathAndFilename', 'vfs://Test/Configuration/PackageStates.php');
178 
179  $packageKey = $expectedPackageKeys[0];
180  ‪$packageManager->_set('packageStatesConfiguration', [
181  'packages' => [
182  $packageKey => [
183  'packagePath' => 'Application/' . $packageKey . '/'
184  ]
185  ],
186  'version' => 5
187  ]);
188  ‪$packageManager->_call('scanAvailablePackages');
189  ‪$packageManager->_call('sortAndSavePackageStates');
190 
191  $packageStates = require 'vfs://Test/Configuration/PackageStates.php';
192  $this->assertEquals('Application/' . $packageKey . '/', $packageStates['packages'][$packageKey]['packagePath']);
193  }
194 
199  {
200  $packageKeys = [
201  $this->getUniqueId('Lolli.Pop.NothingElse'),
202  $this->getUniqueId('TYPO3.Package'),
203  $this->getUniqueId('TYPO3.YetAnotherTestPackage')
204  ];
205 
206  $packagePaths = [];
207  foreach ($packageKeys as $packageKey) {
208  $packagePath = 'vfs://Test/Packages/Application/' . $packageKey . '/';
209 
210  mkdir($packagePath, 0770, true);
211  file_put_contents($packagePath . 'composer.json', '{"name": "' . $packageKey . '", "type": "typo3-cms-test"}');
212  file_put_contents($packagePath . 'ext_emconf.php', '<?php' . LF . '$EM_CONF[$_EXTKEY] = [];');
213  $packagePaths[] = $packagePath;
214  }
215 
217  ‪$packageManager = $this->getAccessibleMock(PackageManager::class, ['sortAndSavePackageStates', 'registerTransientClassLoadingInformationForPackage'], [new ‪DependencyOrderingService]);
218  ‪$packageManager->_set('packagesBasePaths', $packagePaths);
219  ‪$packageManager->_set('packagesBasePath', 'vfs://Test/Packages/');
220  ‪$packageManager->_set('packageStatesPathAndFilename', 'vfs://Test/Configuration/PackageStates.php');
221 
222  ‪$packageManager->_set('packages', []);
223  ‪$packageManager->_call('scanAvailablePackages');
224 
225  $expectedPackageStatesConfiguration = [];
226  foreach ($packageKeys as $packageKey) {
227  $expectedPackageStatesConfiguration[$packageKey] = [
228  'packagePath' => 'Application/' . $packageKey . '/'
229  ];
230  ‪$packageManager->activatePackage($packageKey);
231  }
232 
233  $actualPackageStatesConfiguration = ‪$packageManager->_get('packageStatesConfiguration');
234  $this->assertEquals($expectedPackageStatesConfiguration, $actualPackageStatesConfiguration['packages']);
235  }
236 
242  public function ‪packageKeysAndPaths(): array
243  {
244  return [
245  ['TYPO3.YetAnotherTestPackage', 'vfs://Test/Packages/Application/TYPO3.YetAnotherTestPackage/'],
246  ['Lolli.Pop.NothingElse', 'vfs://Test/Packages/Application/Lolli.Pop.NothingElse/']
247  ];
248  }
249 
255  public function ‪createPackageCreatesPackageFolderAndReturnsPackage($packageKey, $expectedPackagePath): void
256  {
257  $actualPackage = $this->‪createPackage($packageKey);
258  $actualPackagePath = $actualPackage->getPackagePath();
259 
260  $this->assertEquals($expectedPackagePath, $actualPackagePath);
261  $this->assertTrue(is_dir($actualPackagePath), 'Package path should exist after createPackage()');
262  $this->assertEquals($packageKey, $actualPackage->getPackageKey());
263  $this->assertTrue($this->packageManager->isPackageAvailable($packageKey));
264  }
265 
274  {
275  $packageKey = 'Acme.YetAnotherTestPackage';
276 
277  $this->‪createPackage($packageKey);
278 
279  $this->packageManager->expects($this->any())->method('sortActivePackagesByDependencies')->will($this->returnValue([]));
280 
281  $this->packageManager->deactivatePackage($packageKey);
282  $this->assertFalse($this->packageManager->isPackageActive($packageKey));
283 
284  $this->packageManager->activatePackage($packageKey);
285  $this->assertTrue($this->packageManager->isPackageActive($packageKey));
286  }
287 
296  {
297  $this->expectException(ProtectedPackageKeyException::class);
298  $this->expectExceptionCode(1308662891);
299 
300  $package = $this->‪createPackage('Acme.YetAnotherTestPackage');
301  $package->setProtected(true);
302  $this->packageManager->expects($this->any())->method('sortActivePackagesByDependencies')->will($this->returnValue([]));
303  $this->packageManager->deactivatePackage('Acme.YetAnotherTestPackage');
304  }
305 
313  {
314  $this->expectException(UnknownPackageException::class);
315  $this->expectExceptionCode(1166543253);
316 
317  $this->packageManager->expects($this->any())->method('sortActivePackagesByDependencies')->will($this->returnValue([]));
318  $this->packageManager->deletePackage('PrettyUnlikelyThatThisPackageExists');
319  }
320 
329  {
330  $this->expectException(ProtectedPackageKeyException::class);
331  $this->expectExceptionCode(1220722120);
332 
333  $package = $this->‪createPackage('Acme.YetAnotherTestPackage');
334  $package->setProtected(true);
335  $this->packageManager->deletePackage('Acme.YetAnotherTestPackage');
336  }
337 
346  {
347  $this->‪createPackage('Acme.YetAnotherTestPackage');
348 
349  $this->packageManager->expects($this->any())->method('sortActivePackagesByDependencies')->will($this->returnValue([]));
350 
351  $this->assertTrue($this->packageManager->isPackageActive('Acme.YetAnotherTestPackage'));
352  $this->assertTrue($this->packageManager->isPackageAvailable('Acme.YetAnotherTestPackage'));
353 
354  $this->packageManager->deletePackage('Acme.YetAnotherTestPackage');
355 
356  $this->assertFalse($this->packageManager->isPackageActive('Acme.YetAnotherTestPackage'));
357  $this->assertFalse($this->packageManager->isPackageAvailable('Acme.YetAnotherTestPackage'));
358  }
359 
363  public function ‪composerNamesAndPackageKeys(): array
364  {
365  return [
366  ['imagine/Imagine', 'imagine.Imagine'],
367  ['imagine/imagine', 'imagine.Imagine'],
368  ['typo3/cms', 'TYPO3.CMS'],
369  ['TYPO3/CMS', 'TYPO3.CMS']
370  ];
371  }
372 
379  public function ‪getPackageKeyFromComposerNameIgnoresCaseDifferences(string $composerName, string $packageKey): void
380  {
381  $packageStatesConfiguration = [
382  'packages' => [
383  'TYPO3.CMS',
384  'imagine.Imagine'
385  ]
386  ];
387  $composerNameToPackageKeyMap = [
388  'typo3/cms' => 'TYPO3.CMS',
389  'imagine/imagine' => 'imagine.Imagine'
390  ];
391 
392  ‪$packageManager = $this->getAccessibleMock(PackageManager::class, ['resolvePackageDependencies'], [new ‪DependencyOrderingService]);
393  ‪$packageManager->_set('packageStatesConfiguration', $packageStatesConfiguration);
394  ‪$packageManager->_set('composerNameToPackageKeyMap', $composerNameToPackageKeyMap);
395 
396  $this->assertEquals($packageKey, ‪$packageManager->_call('getPackageKeyFromComposerName', $composerName));
397  }
398 
403  {
404  return [
405  'TYPO3 Flow Packages' => [
406  [
407  'TYPO3.Flow' => [
408  'dependencies' => ['Symfony.Component.Yaml', 'Doctrine.Common', 'Doctrine.DBAL', 'Doctrine.ORM']
409  ],
410  'Doctrine.ORM' => [
411  'dependencies' => ['Doctrine.Common', 'Doctrine.DBAL']
412  ],
413  'Doctrine.Common' => [
414  'dependencies' => []
415  ],
416  'Doctrine.DBAL' => [
417  'dependencies' => ['Doctrine.Common']
418  ],
419  'Symfony.Component.Yaml' => [
420  'dependencies' => []
421  ],
422  ],
423  [
424  'Doctrine.Common'
425  ],
426  [
427  'TYPO3.Flow' => [
428  'TYPO3.Flow' => false,
429  'Doctrine.ORM' => true,
430  'Doctrine.Common' => true,
431  'Doctrine.DBAL' => true,
432  'Symfony.Component.Yaml' => true,
433  ],
434  'Doctrine.ORM' => [
435  'TYPO3.Flow' => false,
436  'Doctrine.ORM' => false,
437  'Doctrine.Common' => true,
438  'Doctrine.DBAL' => true,
439  'Symfony.Component.Yaml' => false,
440  ],
441  'Doctrine.Common' => [
442  'TYPO3.Flow' => false,
443  'Doctrine.ORM' => false,
444  'Doctrine.Common' => false,
445  'Doctrine.DBAL' => false,
446  'Symfony.Component.Yaml' => false,
447  ],
448  'Doctrine.DBAL' => [
449  'TYPO3.Flow' => false,
450  'Doctrine.ORM' => false,
451  'Doctrine.Common' => true,
452  'Doctrine.DBAL' => false,
453  'Symfony.Component.Yaml' => false,
454  ],
455  'Symfony.Component.Yaml' => [
456  'TYPO3.Flow' => false,
457  'Doctrine.ORM' => false,
458  'Doctrine.Common' => true,
459  'Doctrine.DBAL' => false,
460  'Symfony.Component.Yaml' => false,
461  ],
462  ],
463  ],
464  'TYPO3 CMS Extensions' => [
465  [
466  'core' => [
467  'dependencies' => [],
468  ],
469  'setup' => [
470  'dependencies' => ['core'],
471  ],
472  'openid' => [
473  'dependencies' => ['core', 'setup']
474  ],
475  'news' => [
476  'dependencies' => ['extbase'],
477  ],
478  'extbase' => [
479  'dependencies' => ['core'],
480  ],
481  'pt_extbase' => [
482  'dependencies' => ['extbase'],
483  ],
484  'foo' => [
485  'dependencies' => [],
486  ],
487  ],
488  [
489  'core',
490  'setup',
491  'openid',
492  'extbase'
493  ],
494  [
495  'core' => [
496  'core' => false,
497  'setup' => false,
498  'openid' => false,
499  'news' => false,
500  'extbase' => false,
501  'pt_extbase' => false,
502  'foo' => false
503  ],
504  'setup' => [
505  'core' => true,
506  'setup' => false,
507  'openid' => false,
508  'news' => false,
509  'extbase' => false,
510  'pt_extbase' => false,
511  'foo' => false
512  ],
513  'openid' => [
514  'core' => true,
515  'setup' => true,
516  'openid' => false,
517  'news' => false,
518  'extbase' => false,
519  'pt_extbase' => false,
520  'foo' => false
521  ],
522  'news' => [
523  'core' => false,
524  'setup' => false,
525  'openid' => true,
526  'news' => false,
527  'extbase' => true,
528  'pt_extbase' => false,
529  'foo' => false
530  ],
531  'extbase' => [
532  'core' => true,
533  'setup' => false,
534  'openid' => false,
535  'news' => false,
536  'extbase' => false,
537  'pt_extbase' => false,
538  'foo' => false
539  ],
540  'pt_extbase' => [
541  'core' => false,
542  'setup' => false,
543  'openid' => true,
544  'news' => false,
545  'extbase' => true,
546  'pt_extbase' => false,
547  'foo' => false
548  ],
549  'foo' => [
550  'core' => false,
551  'setup' => false,
552  'openid' => true,
553  'news' => false,
554  'extbase' => true,
555  'pt_extbase' => false,
556  'foo' => false
557  ],
558  ],
559  ],
560  'Dummy Packages' => [
561  [
562  'A' => [
563  'dependencies' => ['B', 'D', 'C'],
564  ],
565  'B' => [
566  'dependencies' => []
567  ],
568  'C' => [
569  'dependencies' => ['E']
570  ],
571  'D' => [
572  'dependencies' => ['E'],
573  ],
574  'E' => [
575  'dependencies' => [],
576  ],
577  'F' => [
578  'dependencies' => [],
579  ],
580  ],
581  [
582  'B',
583  'C',
584  'E'
585  ],
586  [
587  'A' => [
588  'A' => false,
589  'B' => true,
590  'C' => true,
591  'D' => true,
592  'E' => false,
593  'F' => false,
594  ],
595  'B' => [
596  'A' => false,
597  'B' => false,
598  'C' => false,
599  'D' => false,
600  'E' => false,
601  'F' => false,
602  ],
603  'C' => [
604  'A' => false,
605  'B' => false,
606  'C' => false,
607  'D' => false,
608  'E' => true,
609  'F' => false,
610  ],
611  'D' => [
612  'A' => false,
613  'B' => true,
614  'C' => true,
615  'D' => false,
616  'E' => false,
617  'F' => false,
618  ],
619  'E' => [
620  'A' => false,
621  'B' => false,
622  'C' => false,
623  'D' => false,
624  'E' => false,
625  'F' => false,
626  ],
627  'F' => [
628  'A' => false,
629  'B' => true,
630  'C' => true,
631  'D' => false,
632  'E' => false,
633  'F' => false,
634  ],
635  ],
636  ],
637  ];
638  }
639 
647  public function ‪buildDependencyGraphBuildsCorrectGraph(array $unsortedPackageStatesConfiguration, array $frameworkPackageKeys, array $expectedGraph): void
648  {
649  ‪$packageManager = $this->getAccessibleMock(PackageManager::class, ['findFrameworkPackages'], [new ‪DependencyOrderingService]);
650  ‪$packageManager->expects($this->any())->method('findFrameworkPackages')->willReturn($frameworkPackageKeys);
651 
652  $dependencyGraph = ‪$packageManager->_call('buildDependencyGraph', $unsortedPackageStatesConfiguration);
653 
654  $this->assertEquals($expectedGraph, $dependencyGraph);
655  }
656 
660  public function ‪packageSortingDataProvider(): array
661  {
662  return [
663  'TYPO3 Flow Packages' => [
664  [
665  'TYPO3.Flow' => [
666  'dependencies' => ['Symfony.Component.Yaml', 'Doctrine.Common', 'Doctrine.DBAL', 'Doctrine.ORM']
667  ],
668  'Doctrine.ORM' => [
669  'dependencies' => ['Doctrine.Common', 'Doctrine.DBAL']
670  ],
671  'Doctrine.Common' => [
672  'dependencies' => []
673  ],
674  'Doctrine.DBAL' => [
675  'dependencies' => ['Doctrine.Common']
676  ],
677  'Symfony.Component.Yaml' => [
678  'dependencies' => []
679  ],
680  ],
681  [
682  'Doctrine.Common'
683  ],
684  [
685  'Doctrine.Common',
686  'Doctrine.DBAL',
687  'Doctrine.ORM',
688  'Symfony.Component.Yaml',
689  'TYPO3.Flow',
690  ],
691  ],
692  'TYPO3 CMS Extensions' => [
693  [
694  'core' => [
695  'dependencies' => [],
696  ],
697  'setup' => [
698  'dependencies' => ['core'],
699  ],
700  'openid' => [
701  'dependencies' => ['core', 'setup']
702  ],
703  'news' => [
704  'dependencies' => ['extbase'],
705  ],
706  'extbase' => [
707  'dependencies' => ['core'],
708  ],
709  'pt_extbase' => [
710  'dependencies' => ['extbase'],
711  ],
712  'foo' => [
713  'dependencies' => [],
714  ],
715  ],
716  [
717  'core',
718  'setup',
719  'openid',
720  'extbase'
721  ],
722  [
723  'core',
724  'setup',
725  'openid',
726  'extbase',
727  'foo',
728  'news',
729  'pt_extbase',
730  ],
731  ],
732  'Dummy Packages' => [
733  [
734  'A' => [
735  'dependencies' => ['B', 'D', 'C'],
736  ],
737  'B' => [
738  'dependencies' => []
739  ],
740  'C' => [
741  'dependencies' => ['E']
742  ],
743  'D' => [
744  'dependencies' => ['E'],
745  ],
746  'E' => [
747  'dependencies' => [],
748  ],
749  'F' => [
750  'dependencies' => [],
751  ],
752  ],
753  [
754  'B',
755  'C',
756  'E'
757  ],
758  [
759  'E',
760  'C',
761  'B',
762  'D',
763  'A',
764  'F',
765  ],
766  ],
767  ];
768  }
769 
776  public function ‪sortPackageStatesConfigurationByDependencyMakesSureThatDependantPackagesAreStandingBeforeAPackageInTheInternalPackagesAndPackagesConfigurationArrays($unsortedPackageStatesConfiguration, $frameworkPackageKeys, $expectedSortedPackageKeys): void
777  {
778  ‪$packageManager = $this->getAccessibleMock(PackageManager::class, ['findFrameworkPackages'], [new ‪DependencyOrderingService]);
779  ‪$packageManager->expects($this->any())->method('findFrameworkPackages')->willReturn($frameworkPackageKeys);
780 
781  $sortedPackageKeys = ‪$packageManager->_call('sortPackageStatesConfigurationByDependency', $unsortedPackageStatesConfiguration);
782 
783  $this->assertEquals($expectedSortedPackageKeys, $sortedPackageKeys, 'The package states configurations have not been ordered according to their dependencies!');
784  }
785 
790  {
791  $unsortedPackageStatesConfiguration = [
792  'A' => [
793  'dependencies' => ['B'],
794  ],
795  'B' => [
796  'dependencies' => ['A']
797  ],
798  ];
799 
800  $this->expectException(\UnexpectedValueException::class);
801  $this->expectExceptionCode(1381960494);
802 
803  ‪$packageManager = $this->getAccessibleMock(PackageManager::class, ['findFrameworkPackages'], [new ‪DependencyOrderingService]);
804  ‪$packageManager->expects($this->any())->method('findFrameworkPackages')->willReturn([]);
805 
806  ‪$packageManager->_call('sortPackageStatesConfigurationByDependency', $unsortedPackageStatesConfiguration);
807  }
808 }
‪TYPO3\CMS\Core\Tests\Unit\Package\PackageManagerTest\scanAvailablePackagesTraversesThePackagesDirectoryAndRegistersPackagesItFinds
‪scanAvailablePackagesTraversesThePackagesDirectoryAndRegistersPackagesItFinds()
Definition: PackageManagerTest.php:122
‪TYPO3\CMS\Core\Package\Exception\UnknownPackageException
Definition: UnknownPackageException.php:21
‪TYPO3\CMS\Core\Package\Exception\PackageStatesFileNotWritableException
Definition: PackageStatesFileNotWritableException.php:21
‪TYPO3\CMS\Core\Tests\Unit\Package\composerNamesAndPackageKeys
‪array composerNamesAndPackageKeys()
Definition: PackageManagerTest.php:362
‪TYPO3\CMS\Core\Tests\Unit\Package\getPackageKeyFromComposerNameIgnoresCaseDifferences
‪getPackageKeyFromComposerNameIgnoresCaseDifferences(string $composerName, string $packageKey)
Definition: PackageManagerTest.php:378
‪TYPO3\CMS\Core\Tests\Unit\Package\deletePackageThrowsAnExceptionIfPackageIsProtected
‪deletePackageThrowsAnExceptionIfPackageIsProtected()
Definition: PackageManagerTest.php:327
‪TYPO3\CMS\Core\Tests\Unit\Package\scanAvailablePackagesKeepsExistingPackageConfiguration
‪scanAvailablePackagesKeepsExistingPackageConfiguration()
Definition: PackageManagerTest.php:153
‪TYPO3\CMS\Core\Tests\Unit\Package\sortPackageStatesConfigurationByDependencyMakesSureThatDependantPackagesAreStandingBeforeAPackageInTheInternalPackagesAndPackagesConfigurationArrays
‪sortPackageStatesConfigurationByDependencyMakesSureThatDependantPackagesAreStandingBeforeAPackageInTheInternalPackagesAndPackagesConfigurationArrays($unsortedPackageStatesConfiguration, $frameworkPackageKeys, $expectedSortedPackageKeys)
Definition: PackageManagerTest.php:775
‪TYPO3\CMS\Core\Cache\Frontend\PhpFrontend
Definition: PhpFrontend.php:24
‪TYPO3\CMS\Core\Tests\Unit\Package\PackageManagerTest\getPackageThrowsExceptionOnUnknownPackage
‪getPackageThrowsExceptionOnUnknownPackage()
Definition: PackageManagerTest.php:111
‪TYPO3\CMS\Core\Tests\Unit\Package\deactivatePackageThrowsAnExceptionIfPackageIsProtected
‪deactivatePackageThrowsAnExceptionIfPackageIsProtected()
Definition: PackageManagerTest.php:294
‪TYPO3\CMS\Core\Tests\Unit\Package\deletePackageRemovesPackageFromAvailableAndActivePackagesAndDeletesThePackageDirectory
‪deletePackageRemovesPackageFromAvailableAndActivePackagesAndDeletesThePackageDirectory()
Definition: PackageManagerTest.php:344
‪TYPO3\CMS\Core\Tests\Unit\Package\packageSortingDataProvider
‪array packageSortingDataProvider()
Definition: PackageManagerTest.php:659
‪TYPO3\CMS\Core\Tests\Unit\Package\PackageManagerTest\getPackageReturnsTheSpecifiedPackage
‪getPackageReturnsTheSpecifiedPackage()
Definition: PackageManagerTest.php:99
‪TYPO3\CMS\Core\Tests\Unit\Package\PackageManagerTest
Definition: PackageManagerTest.php:31
‪TYPO3\CMS\Core\Tests\Unit\Package\sortPackageStatesConfigurationByDependencyThrowsExceptionWhenCycleDetected
‪sortPackageStatesConfigurationByDependencyThrowsExceptionWhenCycleDetected()
Definition: PackageManagerTest.php:788
‪TYPO3\CMS\Core\Tests\Unit\Package
Definition: PackageManagerTest.php:3
‪TYPO3\CMS\Core\Tests\Unit\Package\createPackageCreatesPackageFolderAndReturnsPackage
‪createPackageCreatesPackageFolderAndReturnsPackage($packageKey, $expectedPackagePath)
Definition: PackageManagerTest.php:254
‪TYPO3\CMS\Core\Tests\Unit\Package\activatePackageAndDeactivatePackageActivateAndDeactivateTheGivenPackage
‪activatePackageAndDeactivatePackageActivateAndDeactivateTheGivenPackage()
Definition: PackageManagerTest.php:272
‪TYPO3\CMS\Core\Package\Package
Definition: Package.php:21
‪TYPO3\CMS\Core\Tests\Unit\Package\PackageManagerTest\$packageManager
‪PackageManager PHPUnit_Framework_MockObject_MockObject TYPO3 TestingFramework Core AccessibleObjectInterface $packageManager
Definition: PackageManagerTest.php:34
‪TYPO3\CMS\Core\Service\DependencyOrderingService
Definition: DependencyOrderingService.php:31
‪TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend
Definition: SimpleFileBackend.php:32
‪TYPO3\CMS\Core\Tests\Unit\Package\packageKeysAndPaths
‪array packageKeysAndPaths()
Definition: PackageManagerTest.php:241
‪TYPO3\CMS\Core\Package\Exception\InvalidPackageStateException
Definition: InvalidPackageStateException.php:21
‪TYPO3\CMS\Core\Tests\Unit\Package\buildDependencyGraphBuildsCorrectGraphDataProvider
‪array buildDependencyGraphBuildsCorrectGraphDataProvider()
Definition: PackageManagerTest.php:401
‪TYPO3\CMS\Core\Tests\Unit\Package\PackageManagerTest\setUp
‪setUp()
Definition: PackageManagerTest.php:39
‪TYPO3\CMS\Core\Tests\Unit\Package\buildDependencyGraphBuildsCorrectGraph
‪buildDependencyGraphBuildsCorrectGraph(array $unsortedPackageStatesConfiguration, array $frameworkPackageKeys, array $expectedGraph)
Definition: PackageManagerTest.php:646
‪TYPO3\CMS\Core\Package\Exception\ProtectedPackageKeyException
Definition: ProtectedPackageKeyException.php:21
‪TYPO3\CMS\Core\Tests\Unit\Package\packageStatesConfigurationContainsRelativePaths
‪packageStatesConfigurationContainsRelativePaths()
Definition: PackageManagerTest.php:197
‪TYPO3\CMS\Core\Tests\Unit\Package\deletePackageThrowsErrorIfPackageIsNotAvailable
‪deletePackageThrowsErrorIfPackageIsNotAvailable()
Definition: PackageManagerTest.php:311
‪TYPO3\CMS\Core\Tests\Unit\Package\PackageManagerTest\createPackage
‪Package createPackage(string $packageKey)
Definition: PackageManagerTest.php:81