From f4e9dd4fb812d92a45552c3f92e1eb97a014f098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Thu, 14 Jun 2012 12:10:01 +0200 Subject: [PATCH] Fixed PSR rules --- tests/Composer/Test/Autoload/Fixtures/php5.4/traits.php | 6 ++++-- tests/Composer/Test/ComposerTest.php | 2 +- tests/Composer/Test/DependencyResolver/RequestTest.php | 1 - tests/Composer/Test/DependencyResolver/SolverTest.php | 3 --- tests/Composer/Test/Downloader/ArchiveDownloaderTest.php | 2 -- tests/Composer/Test/Downloader/FileDownloaderTest.php | 6 ++++-- tests/Composer/Test/Downloader/ZipDownloaderTest.php | 1 - tests/Composer/Test/FactoryTest.php | 1 + tests/Composer/Test/IO/NullIOTest.php | 2 +- tests/Composer/Test/Installer/InstallerInstallerTest.php | 3 ++- tests/Composer/Test/Installer/LibraryInstallerTest.php | 1 - tests/Composer/Test/InstallerTest.php | 1 - tests/Composer/Test/Mock/InstallationManagerMock.php | 1 - .../Test/Package/LinkConstraint/VersionConstraintTest.php | 4 ++-- tests/Composer/Test/Repository/PearRepositoryTest.php | 5 ++--- tests/Composer/Test/Repository/Vcs/SvnDriverTest.php | 1 - tests/Composer/Test/Repository/VcsRepositoryTest.php | 3 ++- tests/Composer/Test/Script/EventDispatcherTest.php | 2 +- tests/Composer/Test/TestCase.php | 1 + tests/Composer/Test/Util/RemoteFilesystemTest.php | 1 - tests/Composer/Test/Util/SpdxLicenseIdentifierTest.php | 2 +- tests/Composer/Test/Util/SvnTest.php | 2 +- 22 files changed, 23 insertions(+), 28 deletions(-) diff --git a/tests/Composer/Test/Autoload/Fixtures/php5.4/traits.php b/tests/Composer/Test/Autoload/Fixtures/php5.4/traits.php index 5d1fd3c52..34257c712 100644 --- a/tests/Composer/Test/Autoload/Fixtures/php5.4/traits.php +++ b/tests/Composer/Test/Autoload/Fixtures/php5.4/traits.php @@ -4,7 +4,8 @@ namespace { } - class CFoo { + class CFoo + { use TFoo; } } @@ -22,7 +23,8 @@ namespace Foo { } - class CBar implements IBar { + class CBar implements IBar + { use TBar, TFooBar; } } diff --git a/tests/Composer/Test/ComposerTest.php b/tests/Composer/Test/ComposerTest.php index 80feb51ba..6ff841919 100644 --- a/tests/Composer/Test/ComposerTest.php +++ b/tests/Composer/Test/ComposerTest.php @@ -59,4 +59,4 @@ class ComposerTest extends TestCase $this->assertSame($manager, $composer->getInstallationManager()); } -} \ No newline at end of file +} diff --git a/tests/Composer/Test/DependencyResolver/RequestTest.php b/tests/Composer/Test/DependencyResolver/RequestTest.php index 969240860..89639bc44 100644 --- a/tests/Composer/Test/DependencyResolver/RequestTest.php +++ b/tests/Composer/Test/DependencyResolver/RequestTest.php @@ -15,7 +15,6 @@ namespace Composer\Test\DependencyResolver; use Composer\DependencyResolver\Request; use Composer\DependencyResolver\Pool; use Composer\Repository\ArrayRepository; -use Composer\DependencyResolver\Literal; use Composer\Test\TestCase; class RequestTest extends TestCase diff --git a/tests/Composer/Test/DependencyResolver/SolverTest.php b/tests/Composer/Test/DependencyResolver/SolverTest.php index df7f32cf4..7638e9509 100644 --- a/tests/Composer/Test/DependencyResolver/SolverTest.php +++ b/tests/Composer/Test/DependencyResolver/SolverTest.php @@ -12,15 +12,12 @@ namespace Composer\Test\DependencyResolver; use Composer\Repository\ArrayRepository; -use Composer\Repository\PlatformRepository; -use Composer\Repository\ComposerRepository; use Composer\DependencyResolver\DefaultPolicy; use Composer\DependencyResolver\Pool; use Composer\DependencyResolver\Request; use Composer\DependencyResolver\Solver; use Composer\DependencyResolver\SolverProblemsException; use Composer\Package\Link; -use Composer\Package\LinkConstraint\VersionConstraint; use Composer\Test\TestCase; class SolverTest extends TestCase diff --git a/tests/Composer/Test/Downloader/ArchiveDownloaderTest.php b/tests/Composer/Test/Downloader/ArchiveDownloaderTest.php index b7f2c0f53..cf5fde68e 100644 --- a/tests/Composer/Test/Downloader/ArchiveDownloaderTest.php +++ b/tests/Composer/Test/Downloader/ArchiveDownloaderTest.php @@ -12,8 +12,6 @@ namespace Composer\Test\Downloader; -use Composer\Util\Filesystem; - class ArchiveDownloaderTest extends \PHPUnit_Framework_TestCase { public function testGetFileName() diff --git a/tests/Composer/Test/Downloader/FileDownloaderTest.php b/tests/Composer/Test/Downloader/FileDownloaderTest.php index 9b898e68c..a6fff5f1b 100644 --- a/tests/Composer/Test/Downloader/FileDownloaderTest.php +++ b/tests/Composer/Test/Downloader/FileDownloaderTest.php @@ -21,6 +21,7 @@ class FileDownloaderTest extends \PHPUnit_Framework_TestCase { $io = $io ?: $this->getMock('Composer\IO\IOInterface'); $rfs = $rfs ?: $this->getMockBuilder('Composer\Util\RemoteFilesystem')->disableOriginalConstructor()->getMock(); + return new FileDownloader($io, $rfs); } @@ -96,6 +97,7 @@ class FileDownloaderTest extends \PHPUnit_Framework_TestCase if (is_file($path.'/script.js')) { unlink($path.'/script.js'); } + return $messages; })) ; @@ -108,7 +110,7 @@ class FileDownloaderTest extends \PHPUnit_Framework_TestCase if (is_dir($path)) { $fs = new Filesystem(); $fs->removeDirectory($path); - } else if (is_file($path)) { + } elseif (is_file($path)) { unset($path); } @@ -146,7 +148,7 @@ class FileDownloaderTest extends \PHPUnit_Framework_TestCase if (is_dir($path)) { $fs = new Filesystem(); $fs->removeDirectory($path); - } else if (is_file($path)) { + } elseif (is_file($path)) { unset($path); } diff --git a/tests/Composer/Test/Downloader/ZipDownloaderTest.php b/tests/Composer/Test/Downloader/ZipDownloaderTest.php index c0fd6deac..b852329b0 100644 --- a/tests/Composer/Test/Downloader/ZipDownloaderTest.php +++ b/tests/Composer/Test/Downloader/ZipDownloaderTest.php @@ -12,7 +12,6 @@ namespace Composer\Test\Downloader; -use Composer\Util\Filesystem; use Composer\Downloader\ZipDownloader; class ZipDownloaderTest extends \PHPUnit_Framework_TestCase diff --git a/tests/Composer/Test/FactoryTest.php b/tests/Composer/Test/FactoryTest.php index 2bb838fef..12c19f865 100644 --- a/tests/Composer/Test/FactoryTest.php +++ b/tests/Composer/Test/FactoryTest.php @@ -33,6 +33,7 @@ class FactoryTest extends \PHPUnit_Framework_TestCase { $f = function() { $repositories = func_get_args(); + return array('repositories' => $repositories); }; diff --git a/tests/Composer/Test/IO/NullIOTest.php b/tests/Composer/Test/IO/NullIOTest.php index e0e07dd76..07577d5a1 100644 --- a/tests/Composer/Test/IO/NullIOTest.php +++ b/tests/Composer/Test/IO/NullIOTest.php @@ -67,4 +67,4 @@ class NullIOTest extends TestCase $this->assertEquals('foo', $io->askAndValidate('question', 'validator', false, 'foo')); } -} \ No newline at end of file +} diff --git a/tests/Composer/Test/Installer/InstallerInstallerTest.php b/tests/Composer/Test/Installer/InstallerInstallerTest.php index b1a0e14d0..33c941600 100644 --- a/tests/Composer/Test/Installer/InstallerInstallerTest.php +++ b/tests/Composer/Test/Installer/InstallerInstallerTest.php @@ -147,6 +147,7 @@ class InstallerInstallerMock extends InstallerInstaller public function getInstallPath(PackageInterface $package) { $version = $package->getVersion(); + return __DIR__.'/Fixtures/installer-v'.$version[0].'/'; } -} \ No newline at end of file +} diff --git a/tests/Composer/Test/Installer/LibraryInstallerTest.php b/tests/Composer/Test/Installer/LibraryInstallerTest.php index 3edc8a477..4fa83dfe9 100644 --- a/tests/Composer/Test/Installer/LibraryInstallerTest.php +++ b/tests/Composer/Test/Installer/LibraryInstallerTest.php @@ -13,7 +13,6 @@ namespace Composer\Test\Installer; use Composer\Installer\LibraryInstaller; -use Composer\DependencyResolver\Operation; use Composer\Util\Filesystem; use Composer\Test\TestCase; diff --git a/tests/Composer/Test/InstallerTest.php b/tests/Composer/Test/InstallerTest.php index f94a6092b..8361af192 100644 --- a/tests/Composer/Test/InstallerTest.php +++ b/tests/Composer/Test/InstallerTest.php @@ -17,7 +17,6 @@ use Composer\Config; use Composer\Json\JsonFile; use Composer\Repository\ArrayRepository; use Composer\Repository\RepositoryManager; -use Composer\Repository\RepositoryInterface; use Composer\Package\PackageInterface; use Composer\Package\Link; use Composer\Package\Locker; diff --git a/tests/Composer/Test/Mock/InstallationManagerMock.php b/tests/Composer/Test/Mock/InstallationManagerMock.php index 88724a7a5..cc587a6f9 100644 --- a/tests/Composer/Test/Mock/InstallationManagerMock.php +++ b/tests/Composer/Test/Mock/InstallationManagerMock.php @@ -13,7 +13,6 @@ namespace Composer\Test\Mock; use Composer\Installer\InstallationManager; use Composer\Repository\RepositoryInterface; -use Composer\DependencyResolver\Operation\OperationInterface; use Composer\DependencyResolver\Operation\InstallOperation; use Composer\DependencyResolver\Operation\UpdateOperation; use Composer\DependencyResolver\Operation\UninstallOperation; diff --git a/tests/Composer/Test/Package/LinkConstraint/VersionConstraintTest.php b/tests/Composer/Test/Package/LinkConstraint/VersionConstraintTest.php index 7f6e24e4b..15c66c8e7 100644 --- a/tests/Composer/Test/Package/LinkConstraint/VersionConstraintTest.php +++ b/tests/Composer/Test/Package/LinkConstraint/VersionConstraintTest.php @@ -16,7 +16,7 @@ use Composer\Package\LinkConstraint\VersionConstraint; class VersionConstraintTest extends \PHPUnit_Framework_TestCase { - static public function successfulVersionMatches() + public static function successfulVersionMatches() { return array( // require provide @@ -41,7 +41,7 @@ class VersionConstraintTest extends \PHPUnit_Framework_TestCase $this->assertTrue($versionRequire->matches($versionProvide)); } - static public function failingVersionMatches() + public static function failingVersionMatches() { return array( // require provide diff --git a/tests/Composer/Test/Repository/PearRepositoryTest.php b/tests/Composer/Test/Repository/PearRepositoryTest.php index 4df45449d..3172c06f0 100644 --- a/tests/Composer/Test/Repository/PearRepositoryTest.php +++ b/tests/Composer/Test/Repository/PearRepositoryTest.php @@ -12,7 +12,6 @@ namespace Composer\Repository; -use Composer\Repository\FilesystemRepository; use Composer\Test\TestCase; /** @@ -33,7 +32,7 @@ class PearRepositoryTest extends TestCase /** * @dataProvider repositoryDataProvider * @param string $url - * @param array $expectedPackages + * @param array $expectedPackages */ public function testRepositoryRead($url, array $expectedPackages) { @@ -126,4 +125,4 @@ class PearRepositoryTest extends TestCase $this->repository = null; $this->remoteFilesystem = null; } -} \ No newline at end of file +} diff --git a/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php b/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php index 569fab69f..f14a36994 100644 --- a/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php @@ -13,7 +13,6 @@ namespace Composer\Test\Repository\Vcs; use Composer\Repository\Vcs\SvnDriver; -use Composer\IO\NullIO; use Composer\Config; class SvnDriverTest extends \PHPUnit_Framework_TestCase diff --git a/tests/Composer/Test/Repository/VcsRepositoryTest.php b/tests/Composer/Test/Repository/VcsRepositoryTest.php index 8c04c4b0b..8b3272e82 100644 --- a/tests/Composer/Test/Repository/VcsRepositoryTest.php +++ b/tests/Composer/Test/Repository/VcsRepositoryTest.php @@ -15,7 +15,6 @@ namespace Composer\Test\Repository; use Symfony\Component\Process\ExecutableFinder; use Composer\Package\Dumper\ArrayDumper; use Composer\Repository\VcsRepository; -use Composer\Repository\Vcs\GitDriver; use Composer\Util\Filesystem; use Composer\Util\ProcessExecutor; use Composer\IO\NullIO; @@ -37,10 +36,12 @@ class VcsRepositoryTest extends \PHPUnit_Framework_TestCase $locator = new ExecutableFinder(); if (!$locator->find('git')) { $this->skipped = 'This test needs a git binary in the PATH to be able to run'; + return; } if (!mkdir(self::$gitRepo) || !chdir(self::$gitRepo)) { $this->skipped = 'Could not create and move into the temp git repo '.self::$gitRepo; + return; } diff --git a/tests/Composer/Test/Script/EventDispatcherTest.php b/tests/Composer/Test/Script/EventDispatcherTest.php index 2da566907..e23dccf8a 100644 --- a/tests/Composer/Test/Script/EventDispatcherTest.php +++ b/tests/Composer/Test/Script/EventDispatcherTest.php @@ -56,4 +56,4 @@ class EventDispatcherTest extends TestCase { throw new \RuntimeException(); } -} \ No newline at end of file +} diff --git a/tests/Composer/Test/TestCase.php b/tests/Composer/Test/TestCase.php index bbceb3875..a544bdfa9 100644 --- a/tests/Composer/Test/TestCase.php +++ b/tests/Composer/Test/TestCase.php @@ -49,6 +49,7 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase protected function getAliasPackage($package, $version) { $normVersion = self::getVersionParser()->normalize($version); + return new AliasPackage($package, $normVersion, $version); } diff --git a/tests/Composer/Test/Util/RemoteFilesystemTest.php b/tests/Composer/Test/Util/RemoteFilesystemTest.php index 93e42153d..4824e1af9 100644 --- a/tests/Composer/Test/Util/RemoteFilesystemTest.php +++ b/tests/Composer/Test/Util/RemoteFilesystemTest.php @@ -13,7 +13,6 @@ namespace Composer\Test\Util; use Composer\Util\RemoteFilesystem; -use Composer\Test\TestCase; class RemoteFilesystemTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Composer/Test/Util/SpdxLicenseIdentifierTest.php b/tests/Composer/Test/Util/SpdxLicenseIdentifierTest.php index 4b461d31f..2ed7c1819 100644 --- a/tests/Composer/Test/Util/SpdxLicenseIdentifierTest.php +++ b/tests/Composer/Test/Util/SpdxLicenseIdentifierTest.php @@ -91,4 +91,4 @@ class SpdxLicenseIdentifierTest extends TestCase $validator = new SpdxLicenseIdentifier(); $validator->validate($invalidArgument); } -} \ No newline at end of file +} diff --git a/tests/Composer/Test/Util/SvnTest.php b/tests/Composer/Test/Util/SvnTest.php index 2a1839f67..a29db7cee 100644 --- a/tests/Composer/Test/Util/SvnTest.php +++ b/tests/Composer/Test/Util/SvnTest.php @@ -46,4 +46,4 @@ class SvnTest $svn->getCommand('svn ls', $url) ); } -} \ No newline at end of file +}