@@ -16,8 +16,8 @@ |
||
16 | 16 | use ComponentManager\VersionControl\Git\Command\Command; |
17 | 17 | use ComponentManager\VersionControl\Git\Command\FetchCommand; |
18 | 18 | use ComponentManager\VersionControl\Git\Command\InitCommand; |
19 | -use ComponentManager\VersionControl\Git\Command\RevParseCommand; |
|
20 | 19 | use ComponentManager\VersionControl\Git\Command\RemoteAddCommand; |
20 | +use ComponentManager\VersionControl\Git\Command\RevParseCommand; |
|
21 | 21 | use Symfony\Component\Process\Process; |
22 | 22 | use Symfony\Component\Process\ProcessBuilder; |
23 | 23 |
@@ -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 | } |