@ -161,7 +161,7 @@ class AutoloadGeneratorTest extends TestCase
}
}
public function testRootPackageAutoloading()
public function testRootPackageAutoloading(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setAutoload(array(
@ -206,7 +206,7 @@ class AutoloadGeneratorTest extends TestCase
$this->assertAutoloadFiles('classmap', $this->vendorDir.'/composer', 'classmap');
}
public function testRootPackageDevAutoloading()
public function testRootPackageDevAutoloading(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setAutoload(array(
@ -244,7 +244,7 @@ class AutoloadGeneratorTest extends TestCase
$this->assertAutoloadFiles('files2', $this->vendorDir.'/composer', 'files');
}
public function testRootPackageDevAutoloadingDisabledByDefault()
public function testRootPackageDevAutoloadingDisabledByDefault(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setAutoload(array(
@ -277,7 +277,7 @@ class AutoloadGeneratorTest extends TestCase
$this->assertFalse(is_file($this->vendorDir.'/composer/autoload_files.php'));
}
public function testVendorDirSameAsWorkingDir()
public function testVendorDirSameAsWorkingDir(): void
{
$this->vendorDir = $this->workingDir;
@ -308,7 +308,7 @@ class AutoloadGeneratorTest extends TestCase
$this->assertAutoloadFiles('classmap3', $this->vendorDir.'/composer', 'classmap');
}
public function testRootPackageAutoloadingAlternativeVendorDir()
public function testRootPackageAutoloadingAlternativeVendorDir(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setAutoload(array(
@ -337,7 +337,7 @@ class AutoloadGeneratorTest extends TestCase
$this->assertAutoloadFiles('classmap2', $this->vendorDir.'/composer', 'classmap');
}
public function testRootPackageAutoloadingWithTargetDir()
public function testRootPackageAutoloadingWithTargetDir(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setAutoload(array(
@ -368,7 +368,7 @@ class AutoloadGeneratorTest extends TestCase
$this->assertAutoloadFiles('classmap6', $this->vendorDir.'/composer', 'classmap');
}
public function testVendorsAutoloading()
public function testVendorsAutoloading(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setRequires(array(
@ -397,7 +397,7 @@ class AutoloadGeneratorTest extends TestCase
$this->assertFileExists($this->vendorDir.'/composer/autoload_classmap.php', "ClassMap file needs to be generated, even if empty.");
}
public function testNonDevAutoloadExclusionWithRecursion()
public function testNonDevAutoloadExclusionWithRecursion(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setRequires(array(
@ -430,7 +430,7 @@ class AutoloadGeneratorTest extends TestCase
$this->assertFileExists($this->vendorDir.'/composer/autoload_classmap.php', "ClassMap file needs to be generated, even if empty.");
}
public function testNonDevAutoloadShouldIncludeReplacedPackages()
public function testNonDevAutoloadShouldIncludeReplacedPackages(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setRequires(array('a/a' => new Link('a', 'a/a', new MatchAllConstraint())));
@ -464,7 +464,7 @@ class AutoloadGeneratorTest extends TestCase
);
}
public function testNonDevAutoloadExclusionWithRecursionReplace()
public function testNonDevAutoloadExclusionWithRecursionReplace(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setRequires(array(
@ -497,7 +497,7 @@ class AutoloadGeneratorTest extends TestCase
$this->assertFileExists($this->vendorDir.'/composer/autoload_classmap.php', "ClassMap file needs to be generated, even if empty.");
}
public function testNonDevAutoloadReplacesNestedRequirements()
public function testNonDevAutoloadReplacesNestedRequirements(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setRequires(array(
@ -549,7 +549,7 @@ class AutoloadGeneratorTest extends TestCase
$this->assertAutoloadFiles('classmap9', $this->vendorDir.'/composer', 'classmap');
}
public function testPharAutoload()
public function testPharAutoload(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setRequires(array(
@ -590,7 +590,7 @@ class AutoloadGeneratorTest extends TestCase
$this->assertAutoloadFiles('phar_static', $this->vendorDir . '/composer', 'static');
}
public function testPSRToClassMapIgnoresNonExistingDir()
public function testPSRToClassMapIgnoresNonExistingDir(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
@ -613,7 +613,7 @@ class AutoloadGeneratorTest extends TestCase
);
}
public function testPSRToClassMapIgnoresNonPSRClasses()
public function testPSRToClassMapIgnoresNonPSRClasses(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
@ -654,7 +654,7 @@ EOF;
$this->assertStringEqualsFile($this->vendorDir.'/composer/autoload_classmap.php', $expectedClassmap);
}
public function testVendorsClassMapAutoloading()
public function testVendorsClassMapAutoloading(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setRequires(array(
@ -694,7 +694,7 @@ EOF;
$this->assertAutoloadFiles('classmap4', $this->vendorDir.'/composer', 'classmap');
}
public function testVendorsClassMapAutoloadingWithTargetDir()
public function testVendorsClassMapAutoloadingWithTargetDir(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setRequires(array(
@ -734,7 +734,7 @@ EOF;
);
}
public function testClassMapAutoloadingEmptyDirAndExactFile()
public function testClassMapAutoloadingEmptyDirAndExactFile(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setRequires(array(
@ -779,7 +779,7 @@ EOF;
$this->assertStringNotContainsString('$loader->setApcuPrefix(', file_get_contents($this->vendorDir.'/composer/autoload_real.php'));
}
public function testClassMapAutoloadingAuthoritativeAndApcu()
public function testClassMapAutoloadingAuthoritativeAndApcu(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setRequires(array(
@ -828,7 +828,7 @@ EOF;
$this->assertStringContainsString('$loader->setApcuPrefix(', file_get_contents($this->vendorDir.'/composer/autoload_real.php'));
}
public function testClassMapAutoloadingAuthoritativeAndApcuPrefix()
public function testClassMapAutoloadingAuthoritativeAndApcuPrefix(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setRequires(array(
@ -877,7 +877,7 @@ EOF;
$this->assertStringContainsString('$loader->setApcuPrefix(\'custom\\\'Prefix\');', file_get_contents($this->vendorDir.'/composer/autoload_real.php'));
}
public function testFilesAutoloadGeneration()
public function testFilesAutoloadGeneration(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setAutoload(array('files' => array('root.php')));
@ -924,7 +924,7 @@ EOF;
$this->assertTrue(function_exists('testFilesAutoloadGenerationRoot'));
}
public function testFilesAutoloadGenerationRemoveExtraEntitiesFromAutoloadFiles()
public function testFilesAutoloadGenerationRemoveExtraEntitiesFromAutoloadFiles(): void
{
$autoloadPackage = new RootPackage('root/a', '1.0', '1.0');
$autoloadPackage->setAutoload(array('files' => array('root.php')));
@ -995,7 +995,7 @@ EOF;
$this->assertFileDoesNotExist($this->vendorDir.'/composer/include_paths.php');
}
public function testFilesAutoloadOrderByDependencies()
public function testFilesAutoloadOrderByDependencies(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setAutoload(array('files' => array('root2.php')));
@ -1065,7 +1065,7 @@ EOF;
* - The main package has priority over other packages.
* - Longer namespaces have priority over shorter namespaces.
*/
public function testOverrideVendorsAutoloading()
public function testOverrideVendorsAutoloading(): void
{
$rootPackage = new RootPackage('root/z', '1.0', '1.0');
$rootPackage->setAutoload(array(
@ -1160,7 +1160,7 @@ EOF;
$this->assertStringEqualsFile($this->vendorDir.'/composer/autoload_classmap.php', $expectedClassmap);
}
public function testIncludePathFileGeneration()
public function testIncludePathFileGeneration(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$packages = array();
@ -1197,7 +1197,7 @@ EOF;
);
}
public function testIncludePathsArePrependedInAutoloadFile()
public function testIncludePathsArePrependedInAutoloadFile(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$packages = array();
@ -1228,7 +1228,7 @@ EOF;
set_include_path($oldIncludePath);
}
public function testIncludePathsInRootPackage()
public function testIncludePathsInRootPackage(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setIncludePaths(array('/lib', '/src'));
@ -1257,7 +1257,7 @@ EOF;
set_include_path($oldIncludePath);
}
public function testIncludePathFileWithoutPathsIsSkipped()
public function testIncludePathFileWithoutPathsIsSkipped(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$packages = array();
@ -1276,7 +1276,7 @@ EOF;
$this->assertFileDoesNotExist($this->vendorDir."/composer/include_paths.php");
}
public function testPreAndPostEventsAreDispatchedDuringAutoloadDump()
public function testPreAndPostEventsAreDispatchedDuringAutoloadDump(): void
{
$this->eventDispatcher
->expects($this->exactly(2))
@ -1297,7 +1297,7 @@ EOF;
$this->generator->dump($this->config, $this->repository, $package, $this->im, 'composer', true, '_8');
}
public function testUseGlobalIncludePath()
public function testUseGlobalIncludePath(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setAutoload(array(
@ -1318,7 +1318,7 @@ EOF;
$this->assertFileContentEquals(__DIR__.'/Fixtures/autoload_static_include_path.php', $this->vendorDir.'/composer/autoload_static.php');
}
public function testVendorDirExcludedFromWorkingDir()
public function testVendorDirExcludedFromWorkingDir(): void
{
$workingDir = $this->vendorDir.'/working-dir';
$vendorDir = $workingDir.'/../vendor';
@ -1432,7 +1432,7 @@ EOF;
$this->assertStringContainsString("\$baseDir . '/test.php',\n", file_get_contents($vendorDir.'/composer/autoload_files.php'));
}
public function testUpLevelRelativePaths()
public function testUpLevelRelativePaths(): void
{
$workingDir = $this->workingDir.'/working-dir';
mkdir($workingDir, 0777, true);
@ -1516,7 +1516,7 @@ EOF;
$this->assertStringContainsString("\$baseDir . '/../test.php',\n", file_get_contents($this->vendorDir.'/composer/autoload_files.php'));
}
public function testEmptyPaths()
public function testEmptyPaths(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setAutoload(array(
@ -1584,7 +1584,7 @@ EOF;
$this->assertStringEqualsFile($this->vendorDir.'/composer/autoload_classmap.php', $expectedClassmap);
}
public function testVendorSubstringPath()
public function testVendorSubstringPath(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setAutoload(array(
@ -1631,7 +1631,7 @@ EOF;
$this->assertStringEqualsFile($this->vendorDir.'/composer/autoload_psr4.php', $expectedPsr4);
}
public function testExcludeFromClassmap()
public function testExcludeFromClassmap(): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setAutoload(array(
@ -1709,7 +1709,7 @@ EOF;
*
* @dataProvider platformCheckProvider
*/
public function testGeneratesPlatformCheck(array $requires, $expectedFixture, array $provides = array(), array $replaces = array(), $ignorePlatformReqs = false)
public function testGeneratesPlatformCheck(array $requires, $expectedFixture, array $provides = array(), array $replaces = array(), $ignorePlatformReqs = false): void
{
$package = new RootPackage('root/a', '1.0', '1.0');
$package->setRequires($requires);
@ -1850,7 +1850,7 @@ EOF;
*
* @return void
*/
private function assertAutoloadFiles($name, $dir, $type = 'namespaces')
private function assertAutoloadFiles($name, $dir, $type = 'namespaces'): void
{
$a = __DIR__.'/Fixtures/autoload_'.$name.'.php';
$b = $dir.'/autoload_'.$type.'.php';
@ -1864,7 +1864,7 @@ EOF;
*
* @return void
*/
public static function assertFileContentEquals(string $expected, string $actual, ?string $message = null)
public static function assertFileContentEquals(string $expected, string $actual, ?string $message = null): void
{
self::assertSame(
str_replace("\r", '', (string) file_get_contents($expected)),