From e339c7c25b4845f88aa919e273c13d452e6a4655 Mon Sep 17 00:00:00 2001 From: Tom Rochette Date: Tue, 19 May 2015 17:51:56 -0400 Subject: [PATCH] [#60] Adding an interface should be a MINOR increment (not a MAJOR) --- docs/Ruleset.md | 2 +- src/PHPSemVerChecker/Configuration/LevelMapping.php | 2 +- .../Analyzer/InterfaceAnalyzerTest.php | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/Ruleset.md b/docs/Ruleset.md index ef578d5..294adb8 100644 --- a/docs/Ruleset.md +++ b/docs/Ruleset.md @@ -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 diff --git a/src/PHPSemVerChecker/Configuration/LevelMapping.php b/src/PHPSemVerChecker/Configuration/LevelMapping.php index 03aa56b..752f1b2 100644 --- a/src/PHPSemVerChecker/Configuration/LevelMapping.php +++ b/src/PHPSemVerChecker/Configuration/LevelMapping.php @@ -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, diff --git a/tests/PHPSemVerChecker/Analyzer/InterfaceAnalyzerTest.php b/tests/PHPSemVerChecker/Analyzer/InterfaceAnalyzerTest.php index 25ded71..27300e7 100644 --- a/tests/PHPSemVerChecker/Analyzer/InterfaceAnalyzerTest.php +++ b/tests/PHPSemVerChecker/Analyzer/InterfaceAnalyzerTest.php @@ -27,7 +27,7 @@ public function testCompareSimilarInterface() Assert::assertNoDifference($report); } - public function testVXXXInterfaceRemoved() + public function testV033InterfaceRemoved() { $before = new Registry(); $after = new Registry(); @@ -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(); @@ -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()); } }