Skip to content

Commit

Permalink
[#60] Adding an interface should be a MINOR increment (not a MAJOR)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomzx committed May 19, 2015
1 parent 127fa1d commit e339c7c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/Ruleset.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ V062 | PATCH | Class private method parameter name changed

Code | Level | Rule
-----|-------|-------
V032 | MAJOR | Interface added
V032 | MINOR | Interface added
V033 | MAJOR | Interface removed
V034 | MAJOR | Interface method added
V035 | MAJOR | Interface method removed
Expand Down
2 changes: 1 addition & 1 deletion src/PHPSemVerChecker/Configuration/LevelMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class LevelMapping
'V029' => Level::PATCH,
'V030' => Level::PATCH,
'V031' => Level::PATCH,
'V032' => Level::MAJOR,
'V032' => Level::MINOR,
'V033' => Level::MAJOR,
'V034' => Level::MAJOR,
'V035' => Level::MAJOR,
Expand Down
10 changes: 5 additions & 5 deletions tests/PHPSemVerChecker/Analyzer/InterfaceAnalyzerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function testCompareSimilarInterface()
Assert::assertNoDifference($report);
}

public function testVXXXInterfaceRemoved()
public function testV033InterfaceRemoved()
{
$before = new Registry();
$after = new Registry();
Expand All @@ -42,7 +42,7 @@ public function testVXXXInterfaceRemoved()
$this->assertSame('tmp', $report['interface'][Level::MAJOR][0]->getTarget());
}

public function testVXXXInterfaceAdded()
public function testV032InterfaceAdded()
{
$before = new Registry();
$after = new Registry();
Expand All @@ -52,8 +52,8 @@ public function testVXXXInterfaceAdded()
$analyzer = new InterfaceAnalyzer();
$report = $analyzer->analyze($before, $after);

Assert::assertDifference($report, 'interface', Level::MAJOR);
$this->assertSame('Interface was added.', $report['interface'][Level::MAJOR][0]->getReason());
$this->assertSame('tmp', $report['interface'][Level::MAJOR][0]->getTarget());
Assert::assertDifference($report, 'interface', Level::MINOR);
$this->assertSame('Interface was added.', $report['interface'][Level::MINOR][0]->getReason());
$this->assertSame('tmp', $report['interface'][Level::MINOR][0]->getTarget());
}
}

0 comments on commit e339c7c

Please sign in to comment.