‪TYPO3CMS  11.5
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;
21 use PHPUnit\Framework\MockObject\MockObject;
31 use TYPO3\CMS\Core\Package\PackageManager;
34 use TYPO3\TestingFramework\Core\AccessibleObjectInterface;
35 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
36 
40 class ‪PackageManagerTest extends UnitTestCase
41 {
45  protected ‪$packageManager;
46 
50  protected function ‪setUp(): void
51  {
52  parent::setUp();
53  vfsStream::setup('Test');
54 
55  $mockCache = $this->getMockBuilder(PhpFrontend::class)
56  ->onlyMethods(['has', 'set', 'getBackend'])
57  ->disableOriginalConstructor()
58  ->getMock();
59  $mockCacheBackend = $this->getMockBuilder(SimpleFileBackend::class)
60  ->onlyMethods(['has', 'set', 'getCacheDirectory'])
61  ->addMethods(['getBackend'])
62  ->disableOriginalConstructor()
63  ->getMock();
64  $mockCache->method('has')->willReturn(false);
65  $mockCache->method('set')->willReturn(true);
66  $mockCache->method('getBackend')->willReturn($mockCacheBackend);
67  $mockCacheBackend->method('getCacheDirectory')->willReturn('vfs://Test/Cache');
68  $this->packageManager = $this->getAccessibleMock(
69  PackageManager::class,
70  ['sortAndSavePackageStates', 'sortActivePackagesByDependencies', 'registerTransientClassLoadingInformationForPackage'],
72  );
73 
74  mkdir('vfs://Test/Packages/Application', 0700, true);
75  mkdir('vfs://Test/Configuration');
76  file_put_contents('vfs://Test/Configuration/PackageStates.php', "<?php return array ('packages' => array(), 'version' => 5); ");
77 
78  $composerNameToPackageKeyMap = [
79  'typo3/flow' => 'TYPO3.Flow',
80  ];
81 
82  $this->packageManager->setPackageCache(new ‪PackageStatesPackageCache('vfs://Test/Configuration/PackageStates.php', $mockCache));
83  $this->packageManager->_set('composerNameToPackageKeyMap', $composerNameToPackageKeyMap);
84  $this->packageManager->_set('packagesBasePath', 'vfs://Test/Packages/');
85  $this->packageManager->_set('packageStatesPathAndFilename', 'vfs://Test/Configuration/PackageStates.php');
86  }
87 
93  protected function ‪createPackage(string $packageKey): ‪Package
94  {
95  $packagePath = 'vfs://Test/Packages/Application/' . $packageKey . '/';
96  mkdir($packagePath, 0770, true);
97  file_put_contents($packagePath . 'ext_emconf.php', '<?php' . LF . '$EM_CONF[$_EXTKEY] = [];');
98  file_put_contents($packagePath . 'composer.json', '{}');
99  $package = new ‪Package($this->packageManager, $packageKey, $packagePath);
100  $this->packageManager->registerPackage($package);
101  $this->packageManager->activatePackage($packageKey);
102 
103  return $package;
104  }
105 
111  public function ‪getPackageReturnsTheSpecifiedPackage(): void
112  {
113  $this->‪createPackage('TYPO3.MyPackage');
114  $package = $this->packageManager->getPackage('TYPO3.MyPackage');
115 
116  self::assertInstanceOf(Package::class, $package, 'The result of getPackage() was no valid package object.');
117  }
118 
123  public function ‪getPackageThrowsExceptionOnUnknownPackage(): void
124  {
125  $this->expectException(UnknownPackageException::class);
126  $this->expectExceptionCode(1166546734);
127 
128  $this->packageManager->getPackage('PrettyUnlikelyThatThisPackageExists');
129  }
130 
135  {
136  $expectedPackageKeys = [
137  ‪StringUtility::getUniqueId('TYPO3.CMS'),
138  ‪StringUtility::getUniqueId('TYPO3.CMS.Test'),
139  ‪StringUtility::getUniqueId('TYPO3.YetAnotherTestPackage'),
140  ‪StringUtility::getUniqueId('Lolli.Pop.NothingElse'),
141  ];
142 
143  foreach ($expectedPackageKeys as $packageKey) {
144  $packagePath = 'vfs://Test/Packages/Application/' . $packageKey . '/';
145 
146  mkdir($packagePath, 0770, true);
147  file_put_contents($packagePath . 'composer.json', '{"name": "' . $packageKey . '", "type": "typo3-test"}');
148  }
149 
150  ‪$packageManager = $this->getAccessibleMock(PackageManager::class, ['sortAndSavePackageStates'], [new ‪DependencyOrderingService()]);
151  ‪$packageManager->_set('packagesBasePath', 'vfs://Test/Packages/');
152  ‪$packageManager->_set('packageStatesPathAndFilename', 'vfs://Test/Configuration/PackageStates.php');
153 
154  ‪$packageManager->_set('packages', []);
155  ‪$packageManager->_call('scanAvailablePackages');
156 
157  $packageStates = require 'vfs://Test/Configuration/PackageStates.php';
158  $actualPackageKeys = array_keys($packageStates['packages']);
159  self::assertEquals(sort($expectedPackageKeys), sort($actualPackageKeys));
160  }
161 
166  {
167  $expectedPackageKeys = [
168  ‪StringUtility::getUniqueId('TYPO3.CMS'),
169  ‪StringUtility::getUniqueId('TYPO3.CMS.Test'),
170  ‪StringUtility::getUniqueId('TYPO3.YetAnotherTestPackage'),
171  ‪StringUtility::getUniqueId('Lolli.Pop.NothingElse'),
172  ];
173 
174  $packagePaths = [];
175  foreach ($expectedPackageKeys as $packageKey) {
176  $packagePath = 'vfs://Test/Packages/Application/' . $packageKey . '/';
177  $packagePaths[] = $packagePath;
178 
179  mkdir($packagePath, 0770, true);
180  file_put_contents($packagePath . 'composer.json', '{"name": "' . $packageKey . '", "type": "typo3-cms-test"}');
181  file_put_contents($packagePath . 'ext_emconf.php', '<?php' . LF . '$EM_CONF[$_EXTKEY] = [];');
182  }
183 
184  ‪$packageManager = $this->getAccessibleMock(PackageManager::class, ['dummy'], [new ‪DependencyOrderingService()]);
185  ‪$packageManager->_set('packagesBasePaths', $packagePaths);
186  ‪$packageManager->_set('packagesBasePath', 'vfs://Test/Packages/');
187  ‪$packageManager->_set('packageStatesPathAndFilename', 'vfs://Test/Configuration/PackageStates.php');
188  $mockCache = $this->getMockBuilder(PhpFrontend::class)->disableOriginalConstructor()->getMock();
189  ‪$packageManager->_set('packageCache', new ‪PackageStatesPackageCache('vfs://Test/Configuration/PackageStates.php', $mockCache));
190 
191  $packageKey = $expectedPackageKeys[0];
192  ‪$packageManager->_set('packageStatesConfiguration', [
193  'packages' => [
194  $packageKey => [
195  'packagePath' => 'Application/' . $packageKey . '/',
196  ],
197  ],
198  'version' => 5,
199  ]);
200  ‪$packageManager->_call('scanAvailablePackages');
201  ‪$packageManager->_call('sortAndSavePackageStates');
202 
203  $packageStates = require 'vfs://Test/Configuration/PackageStates.php';
204  self::assertEquals('Application/' . $packageKey . '/', $packageStates['packages'][$packageKey]['packagePath']);
205  }
206 
211  {
212  $package = $this->‪createPackage('typo3/my-package');
213 
214  $resolvedPackage = $this->packageManager->extractPackageKeyFromPackagePath('EXT:typo3/my-package/path/to/file');
215 
216  self::assertSame('typo3/my-package', $resolvedPackage);
217  }
218 
224  {
225  $this->expectException(UnknownPackageException::class);
226  $this->expectExceptionCode(1631630764);
227 
228  $this->packageManager->extractPackageKeyFromPackagePath('vfs://Test/Packages/Application/InvalidPackage/');
229  }
230 
236  {
237  $this->expectException(UnknownPackagePathException::class);
238  $this->expectExceptionCode(1631630087);
239 
240  $this->packageManager->extractPackageKeyFromPackagePath('EXT:typo3/my-package/path/to/file');
241  }
242 
247  {
248  $packageKeys = [
249  ‪StringUtility::getUniqueId('Lolli.Pop.NothingElse'),
250  ‪StringUtility::getUniqueId('TYPO3.Package'),
251  ‪StringUtility::getUniqueId('TYPO3.YetAnotherTestPackage'),
252  ];
253 
254  $packagePaths = [];
255  foreach ($packageKeys as $packageKey) {
256  $packagePath = 'vfs://Test/Packages/Application/' . $packageKey . '/';
257 
258  mkdir($packagePath, 0770, true);
259  file_put_contents($packagePath . 'composer.json', '{"name": "' . $packageKey . '", "type": "typo3-cms-test"}');
260  file_put_contents($packagePath . 'ext_emconf.php', '<?php' . LF . '$EM_CONF[$_EXTKEY] = [];');
261  $packagePaths[] = $packagePath;
262  }
263 
264  ‪$packageManager = $this->getAccessibleMock(PackageManager::class, ['sortAndSavePackageStates', 'registerTransientClassLoadingInformationForPackage'], [new ‪DependencyOrderingService()]);
265  ‪$packageManager->_set('packagesBasePaths', $packagePaths);
266  ‪$packageManager->_set('packagesBasePath', 'vfs://Test/Packages/');
267  ‪$packageManager->_set('packageStatesPathAndFilename', 'vfs://Test/Configuration/PackageStates.php');
268 
269  ‪$packageManager->_set('packages', []);
270  ‪$packageManager->_call('scanAvailablePackages');
271 
272  $expectedPackageStatesConfiguration = [];
273  foreach ($packageKeys as $packageKey) {
274  $expectedPackageStatesConfiguration[$packageKey] = [
275  'packagePath' => 'Application/' . $packageKey . '/',
276  ];
277  ‪$packageManager->activatePackage($packageKey);
278  }
279 
280  $actualPackageStatesConfiguration = ‪$packageManager->_get('packageStatesConfiguration');
281  self::assertEquals($expectedPackageStatesConfiguration, $actualPackageStatesConfiguration['packages']);
282  }
283 
289  public function ‪packageKeysAndPaths(): array
290  {
291  return [
292  ['TYPO3.YetAnotherTestPackage', 'vfs://Test/Packages/Application/TYPO3.YetAnotherTestPackage/'],
293  ['Lolli.Pop.NothingElse', 'vfs://Test/Packages/Application/Lolli.Pop.NothingElse/'],
294  ];
295  }
296 
302  public function ‪createPackageCreatesPackageFolderAndReturnsPackage($packageKey, $expectedPackagePath): void
303  {
304  $actualPackage = $this->‪createPackage($packageKey);
305  $actualPackagePath = $actualPackage->getPackagePath();
306 
307  self::assertEquals($expectedPackagePath, $actualPackagePath);
308  self::assertDirectoryExists($actualPackagePath, 'Package path should exist after createPackage()');
309  self::assertEquals($packageKey, $actualPackage->getPackageKey());
310  self::assertTrue($this->packageManager->isPackageAvailable($packageKey));
311  }
312 
321  {
322  $packageKey = 'Acme.YetAnotherTestPackage';
323 
324  $this->‪createPackage($packageKey);
325 
326  $this->packageManager->method('sortActivePackagesByDependencies')->willReturn([]);
327 
328  $this->packageManager->deactivatePackage($packageKey);
329  self::assertFalse($this->packageManager->isPackageActive($packageKey));
330 
331  $this->packageManager->activatePackage($packageKey);
332  self::assertTrue($this->packageManager->isPackageActive($packageKey));
333  }
334 
343  {
344  $this->expectException(ProtectedPackageKeyException::class);
345  $this->expectExceptionCode(1308662891);
346 
347  $package = $this->‪createPackage('Acme.YetAnotherTestPackage');
348  $package->setProtected(true);
349  $this->packageManager->method('sortActivePackagesByDependencies')->willReturn([]);
350  $this->packageManager->deactivatePackage('Acme.YetAnotherTestPackage');
351  }
352 
360  {
361  $this->expectException(UnknownPackageException::class);
362  $this->expectExceptionCode(1166543253);
363 
364  $this->packageManager->method('sortActivePackagesByDependencies')->willReturn([]);
365  $this->packageManager->deletePackage('PrettyUnlikelyThatThisPackageExists');
366  }
367 
376  {
377  $this->expectException(ProtectedPackageKeyException::class);
378  $this->expectExceptionCode(1220722120);
379 
380  $package = $this->‪createPackage('Acme.YetAnotherTestPackage');
381  $package->setProtected(true);
382  $this->packageManager->deletePackage('Acme.YetAnotherTestPackage');
383  }
384 
393  {
394  $this->‪createPackage('Acme.YetAnotherTestPackage');
395 
396  $this->packageManager->method('sortActivePackagesByDependencies')->willReturn([]);
397 
398  self::assertTrue($this->packageManager->isPackageActive('Acme.YetAnotherTestPackage'));
399  self::assertTrue($this->packageManager->isPackageAvailable('Acme.YetAnotherTestPackage'));
400 
401  $this->packageManager->deletePackage('Acme.YetAnotherTestPackage');
402 
403  self::assertFalse($this->packageManager->isPackageActive('Acme.YetAnotherTestPackage'));
404  self::assertFalse($this->packageManager->isPackageAvailable('Acme.YetAnotherTestPackage'));
405  }
406 
411  {
412  return [
413  'TYPO3 CMS Extensions' => [
414  [
415  'core' => [
416  'dependencies' => [],
417  ],
418  'setup' => [
419  'dependencies' => ['core'],
420  ],
421  'openid' => [
422  'dependencies' => ['core', 'setup'],
423  ],
424  'news' => [
425  'dependencies' => ['extbase'],
426  ],
427  'extbase' => [
428  'dependencies' => ['core'],
429  ],
430  'pt_extbase' => [
431  'dependencies' => ['extbase'],
432  ],
433  'foo' => [
434  'dependencies' => [],
435  ],
436  ],
437  [
438  'core',
439  'setup',
440  'openid',
441  'extbase',
442  ],
443  [
444  'core' => [
445  'core' => false,
446  'setup' => false,
447  'openid' => false,
448  'news' => false,
449  'extbase' => false,
450  'pt_extbase' => false,
451  'foo' => false,
452  ],
453  'setup' => [
454  'core' => true,
455  'setup' => false,
456  'openid' => false,
457  'news' => false,
458  'extbase' => false,
459  'pt_extbase' => false,
460  'foo' => false,
461  ],
462  'openid' => [
463  'core' => true,
464  'setup' => true,
465  'openid' => false,
466  'news' => false,
467  'extbase' => false,
468  'pt_extbase' => false,
469  'foo' => false,
470  ],
471  'news' => [
472  'core' => false,
473  'setup' => false,
474  'openid' => true,
475  'news' => false,
476  'extbase' => true,
477  'pt_extbase' => false,
478  'foo' => false,
479  ],
480  'extbase' => [
481  'core' => true,
482  'setup' => false,
483  'openid' => false,
484  'news' => false,
485  'extbase' => false,
486  'pt_extbase' => false,
487  'foo' => false,
488  ],
489  'pt_extbase' => [
490  'core' => false,
491  'setup' => false,
492  'openid' => true,
493  'news' => false,
494  'extbase' => true,
495  'pt_extbase' => false,
496  'foo' => false,
497  ],
498  'foo' => [
499  'core' => false,
500  'setup' => false,
501  'openid' => true,
502  'news' => false,
503  'extbase' => true,
504  'pt_extbase' => false,
505  'foo' => false,
506  ],
507  ],
508  ],
509  'Dummy Packages' => [
510  [
511  'A' => [
512  'dependencies' => ['B', 'D', 'C'],
513  ],
514  'B' => [
515  'dependencies' => [],
516  ],
517  'C' => [
518  'dependencies' => ['E'],
519  ],
520  'D' => [
521  'dependencies' => ['E'],
522  ],
523  'E' => [
524  'dependencies' => [],
525  ],
526  'F' => [
527  'dependencies' => [],
528  ],
529  ],
530  [
531  'B',
532  'C',
533  'E',
534  ],
535  [
536  'A' => [
537  'A' => false,
538  'B' => true,
539  'C' => true,
540  'D' => true,
541  'E' => false,
542  'F' => false,
543  ],
544  'B' => [
545  'A' => false,
546  'B' => false,
547  'C' => false,
548  'D' => false,
549  'E' => false,
550  'F' => false,
551  ],
552  'C' => [
553  'A' => false,
554  'B' => false,
555  'C' => false,
556  'D' => false,
557  'E' => true,
558  'F' => false,
559  ],
560  'D' => [
561  'A' => false,
562  'B' => true,
563  'C' => true,
564  'D' => false,
565  'E' => false,
566  'F' => false,
567  ],
568  'E' => [
569  'A' => false,
570  'B' => false,
571  'C' => false,
572  'D' => false,
573  'E' => false,
574  'F' => false,
575  ],
576  'F' => [
577  'A' => false,
578  'B' => true,
579  'C' => true,
580  'D' => false,
581  'E' => false,
582  'F' => false,
583  ],
584  ],
585  ],
586  ];
587  }
588 
596  public function ‪buildDependencyGraphBuildsCorrectGraph(array $unsortedPackageStatesConfiguration, array $frameworkPackageKeys, array $expectedGraph): void
597  {
598  ‪$packageManager = $this->getAccessibleMock(PackageManager::class, ['findFrameworkPackages'], [new ‪DependencyOrderingService()]);
599  ‪$packageManager->method('findFrameworkPackages')->willReturn($frameworkPackageKeys);
600 
601  $dependencyGraph = ‪$packageManager->_call('buildDependencyGraph', $unsortedPackageStatesConfiguration);
602 
603  self::assertEquals($expectedGraph, $dependencyGraph);
604  }
605 
609  public function ‪packageSortingDataProvider(): array
610  {
611  return [
612  'TYPO3 Flow Packages' => [
613  [
614  'TYPO3.Flow' => [
615  'dependencies' => ['Symfony.Component.Yaml', 'Doctrine.Common', 'Doctrine.DBAL', 'Doctrine.ORM'],
616  ],
617  'Doctrine.ORM' => [
618  'dependencies' => ['Doctrine.Common', 'Doctrine.DBAL'],
619  ],
620  'Doctrine.Common' => [
621  'dependencies' => [],
622  ],
623  'Doctrine.DBAL' => [
624  'dependencies' => ['Doctrine.Common'],
625  ],
626  'Symfony.Component.Yaml' => [
627  'dependencies' => [],
628  ],
629  ],
630  [
631  'Doctrine.Common',
632  ],
633  [
634  'Doctrine.Common',
635  'Doctrine.DBAL',
636  'Doctrine.ORM',
637  'Symfony.Component.Yaml',
638  'TYPO3.Flow',
639  ],
640  ],
641  'TYPO3 CMS Extensions' => [
642  [
643  'core' => [
644  'dependencies' => [],
645  ],
646  'setup' => [
647  'dependencies' => ['core'],
648  ],
649  'openid' => [
650  'dependencies' => ['core', 'setup'],
651  ],
652  'news' => [
653  'dependencies' => ['extbase'],
654  ],
655  'extbase' => [
656  'dependencies' => ['core'],
657  ],
658  'pt_extbase' => [
659  'dependencies' => ['extbase'],
660  ],
661  'foo' => [
662  'dependencies' => [],
663  ],
664  ],
665  [
666  'core',
667  'setup',
668  'openid',
669  'extbase',
670  ],
671  [
672  'core',
673  'setup',
674  'openid',
675  'extbase',
676  'foo',
677  'news',
678  'pt_extbase',
679  ],
680  ],
681  'Dummy Packages' => [
682  [
683  'A' => [
684  'dependencies' => ['B', 'D', 'C'],
685  ],
686  'B' => [
687  'dependencies' => [],
688  ],
689  'C' => [
690  'dependencies' => ['E'],
691  ],
692  'D' => [
693  'dependencies' => ['E'],
694  ],
695  'E' => [
696  'dependencies' => [],
697  ],
698  'F' => [
699  'dependencies' => [],
700  ],
701  ],
702  [
703  'B',
704  'C',
705  'E',
706  ],
707  [
708  'E',
709  'C',
710  'B',
711  'D',
712  'A',
713  'F',
714  ],
715  ],
716  ];
717  }
718 
724  array $unsortedPackageStatesConfiguration,
725  array $frameworkPackageKeys,
726  array $expectedSortedPackageKeys
727  ): void {
728  ‪$packageManager = $this->getAccessibleMock(PackageManager::class, ['findFrameworkPackages'], [new ‪DependencyOrderingService()]);
729  ‪$packageManager->method('findFrameworkPackages')->willReturn($frameworkPackageKeys);
730 
731  $sortedPackageKeys = ‪$packageManager->_call('sortPackageStatesConfigurationByDependency', $unsortedPackageStatesConfiguration);
732 
733  self::assertEquals($expectedSortedPackageKeys, $sortedPackageKeys, 'The package states configurations have not been ordered according to their dependencies!');
734  }
735 
740  {
741  $unsortedPackageStatesConfiguration = [
742  'A' => [
743  'dependencies' => ['B'],
744  ],
745  'B' => [
746  'dependencies' => ['A'],
747  ],
748  ];
749 
750  $this->expectException(\UnexpectedValueException::class);
751  $this->expectExceptionCode(1381960494);
752 
753  ‪$packageManager = $this->getAccessibleMock(PackageManager::class, ['findFrameworkPackages'], [new ‪DependencyOrderingService()]);
754  ‪$packageManager->method('findFrameworkPackages')->willReturn([]);
755 
756  ‪$packageManager->_call('sortPackageStatesConfigurationByDependency', $unsortedPackageStatesConfiguration);
757  }
758 }
‪TYPO3\CMS\Core\Tests\Unit\Package\PackageManagerTest\scanAvailablePackagesTraversesThePackagesDirectoryAndRegistersPackagesItFinds
‪scanAvailablePackagesTraversesThePackagesDirectoryAndRegistersPackagesItFinds()
Definition: PackageManagerTest.php:133
‪TYPO3\CMS\Core\Package\Exception\UnknownPackageException
Definition: UnknownPackageException.php:23
‪TYPO3\CMS\Core\Package\Exception\PackageStatesFileNotWritableException
Definition: PackageStatesFileNotWritableException.php:23
‪TYPO3\CMS\Core\Tests\Unit\Package\sortPackageStatesConfigurationByDependencyMakesSureThatDependantPackagesAreStandingBeforeAPackageInTheInternalPackagesAndPackagesConfigurationArrays
‪sortPackageStatesConfigurationByDependencyMakesSureThatDependantPackagesAreStandingBeforeAPackageInTheInternalPackagesAndPackagesConfigurationArrays(array $unsortedPackageStatesConfiguration, array $frameworkPackageKeys, array $expectedSortedPackageKeys)
Definition: PackageManagerTest.php:722
‪TYPO3\CMS\Core\Package\Cache\PackageStatesPackageCache
Definition: PackageStatesPackageCache.php:30
‪TYPO3\CMS\Core\Tests\Unit\Package\deletePackageThrowsAnExceptionIfPackageIsProtected
‪deletePackageThrowsAnExceptionIfPackageIsProtected()
Definition: PackageManagerTest.php:374
‪TYPO3\CMS\Core\Tests\Unit\Package\scanAvailablePackagesKeepsExistingPackageConfiguration
‪scanAvailablePackagesKeepsExistingPackageConfiguration()
Definition: PackageManagerTest.php:164
‪TYPO3\CMS\Core\Cache\Frontend\PhpFrontend
Definition: PhpFrontend.php:25
‪TYPO3\CMS\Core\Tests\Unit\Package\PackageManagerTest\getPackageThrowsExceptionOnUnknownPackage
‪getPackageThrowsExceptionOnUnknownPackage()
Definition: PackageManagerTest.php:122
‪TYPO3\CMS\Core\Tests\Unit\Package\deactivatePackageThrowsAnExceptionIfPackageIsProtected
‪deactivatePackageThrowsAnExceptionIfPackageIsProtected()
Definition: PackageManagerTest.php:341
‪TYPO3\CMS\Core\Tests\Unit\Package\deletePackageRemovesPackageFromAvailableAndActivePackagesAndDeletesThePackageDirectory
‪deletePackageRemovesPackageFromAvailableAndActivePackagesAndDeletesThePackageDirectory()
Definition: PackageManagerTest.php:391
‪TYPO3\CMS\Core\Tests\Unit\Package\packageSortingDataProvider
‪array packageSortingDataProvider()
Definition: PackageManagerTest.php:608
‪TYPO3\CMS\Core\Tests\Unit\Package\PackageManagerTest\getPackageReturnsTheSpecifiedPackage
‪getPackageReturnsTheSpecifiedPackage()
Definition: PackageManagerTest.php:110
‪TYPO3\CMS\Core\Tests\Unit\Package\PackageManagerTest
Definition: PackageManagerTest.php:41
‪TYPO3\CMS\Core\Tests\Unit\Package\sortPackageStatesConfigurationByDependencyThrowsExceptionWhenCycleDetected
‪sortPackageStatesConfigurationByDependencyThrowsExceptionWhenCycleDetected()
Definition: PackageManagerTest.php:738
‪TYPO3\CMS\Core\Tests\Unit\Package\extractPackageKeyFromPackagePathThrowsExceptionOnInvalidPackagePaths
‪extractPackageKeyFromPackagePathThrowsExceptionOnInvalidPackagePaths()
Definition: PackageManagerTest.php:234
‪TYPO3\CMS\Core\Tests\Unit\Package\extractPackageKeyFromPackagePathFindsPackageKey
‪extractPackageKeyFromPackagePathFindsPackageKey()
Definition: PackageManagerTest.php:209
‪TYPO3\CMS\Core\Tests\Unit\Package
Definition: AbstractServiceProviderTest.php:18
‪TYPO3\CMS\Core\Package\Exception\UnknownPackagePathException
Definition: UnknownPackagePathException.php:23
‪TYPO3\CMS\Core\Tests\Unit\Package\createPackageCreatesPackageFolderAndReturnsPackage
‪createPackageCreatesPackageFolderAndReturnsPackage($packageKey, $expectedPackagePath)
Definition: PackageManagerTest.php:301
‪TYPO3\CMS\Core\Tests\Unit\Package\activatePackageAndDeactivatePackageActivateAndDeactivateTheGivenPackage
‪activatePackageAndDeactivatePackageActivateAndDeactivateTheGivenPackage()
Definition: PackageManagerTest.php:319
‪TYPO3\CMS\Core\Package\Package
Definition: Package.php:28
‪TYPO3\CMS\Core\Service\DependencyOrderingService
Definition: DependencyOrderingService.php:32
‪TYPO3\CMS\Core\Tests\Unit\Package\extractPackageKeyFromPackagePathThrowsExceptionOnNonPackagePaths
‪extractPackageKeyFromPackagePathThrowsExceptionOnNonPackagePaths()
Definition: PackageManagerTest.php:222
‪TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend
Definition: SimpleFileBackend.php:33
‪TYPO3\CMS\Core\Tests\Unit\Package\PackageManagerTest\$packageManager
‪PackageManager MockObject AccessibleObjectInterface $packageManager
Definition: PackageManagerTest.php:44
‪TYPO3\CMS\Core\Tests\Unit\Package\packageKeysAndPaths
‪array packageKeysAndPaths()
Definition: PackageManagerTest.php:288
‪TYPO3\CMS\Core\Utility\StringUtility\getUniqueId
‪static string getUniqueId($prefix='')
Definition: StringUtility.php:128
‪TYPO3\CMS\Core\Package\Exception\InvalidPackageStateException
Definition: InvalidPackageStateException.php:23
‪TYPO3\CMS\Core\Tests\Unit\Package\buildDependencyGraphBuildsCorrectGraphDataProvider
‪array buildDependencyGraphBuildsCorrectGraphDataProvider()
Definition: PackageManagerTest.php:409
‪TYPO3\CMS\Core\Tests\Unit\Package\PackageManagerTest\setUp
‪setUp()
Definition: PackageManagerTest.php:49
‪TYPO3\CMS\Core\Tests\Unit\Package\buildDependencyGraphBuildsCorrectGraph
‪buildDependencyGraphBuildsCorrectGraph(array $unsortedPackageStatesConfiguration, array $frameworkPackageKeys, array $expectedGraph)
Definition: PackageManagerTest.php:595
‪TYPO3\CMS\Core\Utility\StringUtility
Definition: StringUtility.php:22
‪TYPO3\CMS\Core\Package\Exception\ProtectedPackageKeyException
Definition: ProtectedPackageKeyException.php:23
‪TYPO3\CMS\Core\Tests\Unit\Package\packageStatesConfigurationContainsRelativePaths
‪packageStatesConfigurationContainsRelativePaths()
Definition: PackageManagerTest.php:245
‪TYPO3\CMS\Core\Tests\Unit\Package\deletePackageThrowsErrorIfPackageIsNotAvailable
‪deletePackageThrowsErrorIfPackageIsNotAvailable()
Definition: PackageManagerTest.php:358
‪TYPO3\CMS\Core\Tests\Unit\Package\PackageManagerTest\createPackage
‪Package createPackage(string $packageKey)
Definition: PackageManagerTest.php:92