@@ -20,33 +20,33 @@ |
||
| 20 | 20 | * @coversDefaultClass \ComponentManager\Component |
| 21 | 21 | */ |
| 22 | 22 | class ComponentTest extends TestCase { |
| 23 | - public function testGetNameParts() { |
|
| 24 | - $component = new Component('type_name', []); |
|
| 25 | - $this->assertEquals(['type', 'name'], $component->getNameParts()); |
|
| 26 | - $this->assertEquals('type', $component->getPluginType()); |
|
| 27 | - $this->assertEquals('name', $component->getPluginName()); |
|
| 28 | - } |
|
| 29 | - |
|
| 30 | - public function testGetVersion() { |
|
| 31 | - $goodPackageRepository = $this->createMock(PackageRepository::class); |
|
| 32 | - $goodPackageRepository->method('satisfiesVersion') |
|
| 33 | - ->willReturn(true); |
|
| 34 | - $badPackageRepository = $this->createMock(PackageRepository::class); |
|
| 35 | - $badPackageRepository->method('satisfiesVersion') |
|
| 36 | - ->willReturn(false); |
|
| 37 | - |
|
| 38 | - $componentVersion = new ComponentVersion( |
|
| 23 | + public function testGetNameParts() { |
|
| 24 | + $component = new Component('type_name', []); |
|
| 25 | + $this->assertEquals(['type', 'name'], $component->getNameParts()); |
|
| 26 | + $this->assertEquals('type', $component->getPluginType()); |
|
| 27 | + $this->assertEquals('name', $component->getPluginName()); |
|
| 28 | + } |
|
| 29 | + |
|
| 30 | + public function testGetVersion() { |
|
| 31 | + $goodPackageRepository = $this->createMock(PackageRepository::class); |
|
| 32 | + $goodPackageRepository->method('satisfiesVersion') |
|
| 33 | + ->willReturn(true); |
|
| 34 | + $badPackageRepository = $this->createMock(PackageRepository::class); |
|
| 35 | + $badPackageRepository->method('satisfiesVersion') |
|
| 36 | + ->willReturn(false); |
|
| 37 | + |
|
| 38 | + $componentVersion = new ComponentVersion( |
|
| 39 | 39 | '2015021800', 'Genesis', ComponentVersion::MATURITY_STABLE, []); |
| 40 | 40 | |
| 41 | - $component = new Component( |
|
| 41 | + $component = new Component( |
|
| 42 | 42 | 'type_name', [$componentVersion], $goodPackageRepository); |
| 43 | - $this->assertEquals( |
|
| 43 | + $this->assertEquals( |
|
| 44 | 44 | $componentVersion, $component->getVersion('2015021800')); |
| 45 | 45 | |
| 46 | - $this->expectException(UnsatisfiedVersionException::class); |
|
| 47 | - $this->expectExceptionCode(UnsatisfiedVersionException::CODE_UNKNOWN_VERSION); |
|
| 48 | - $component = new Component( |
|
| 46 | + $this->expectException(UnsatisfiedVersionException::class); |
|
| 47 | + $this->expectExceptionCode(UnsatisfiedVersionException::CODE_UNKNOWN_VERSION); |
|
| 48 | + $component = new Component( |
|
| 49 | 49 | 'type_name', [$componentVersion], $badPackageRepository); |
| 50 | - $component->getVersion('2015021800'); |
|
| 51 | - } |
|
| 50 | + $component->getVersion('2015021800'); |
|
| 51 | + } |
|
| 52 | 52 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * |
| 86 | 86 | * @throws VersionControlException |
| 87 | 87 | */ |
| 88 | - public function runCommand(Command $command, $exceptionCode=null) { |
|
| 88 | + public function runCommand(Command $command, $exceptionCode = null) { |
|
| 89 | 89 | $process = $this->createProcess($command->getCommandLine()); |
| 90 | 90 | $process->run(); |
| 91 | 91 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | * |
| 160 | 160 | * @codeCoverageIgnore |
| 161 | 161 | */ |
| 162 | - public function fetch($remote=null) { |
|
| 162 | + public function fetch($remote = null) { |
|
| 163 | 163 | $command = new FetchCommand($remote); |
| 164 | 164 | return $this->runCommand( |
| 165 | 165 | $command, VersionControlException::CODE_FETCH_FAILED); |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | * |
| 177 | 177 | * @codeCoverageIgnore |
| 178 | 178 | */ |
| 179 | - public function fetchTags($remote=null) { |
|
| 179 | + public function fetchTags($remote = null) { |
|
| 180 | 180 | $command = new FetchCommand($remote); |
| 181 | 181 | $command->setTags(true); |
| 182 | 182 | return $this->runCommand( |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | * |
| 34 | 34 | * @param string|null $remote |
| 35 | 35 | */ |
| 36 | - public function __construct($remote=null) { |
|
| 36 | + public function __construct($remote = null) { |
|
| 37 | 37 | $this->remote = $remote; |
| 38 | 38 | } |
| 39 | 39 | |