/** * @test */ public function setCommitLineSetsCommitClassEvenIfStrangelyWritten() { $this->fixture->setCommitLine('[bugFIX] Foobar fixed'); $this->assertEquals(\Mrimann\CoMo\Domain\Model\Commit::CLASS_BUGFIX, $this->fixture->getCommitClass()); }
/** * Adds a given commit (without further checking). Adding in this case means that some counters * in this object are raised - depending on some properties of the commit. * * @param Commit $commit * @return void */ public function addCommit(\Mrimann\CoMo\Domain\Model\Commit $commit) { // Update the generic commit counter $this->commitCount++; // Update the topic commit counter, depending on the commit class of the commit switch ($commit->getCommitClass()) { case \Mrimann\CoMo\Domain\Model\Commit::CLASS_FEATURE: $this->commitCountFeature++; break; case \Mrimann\CoMo\Domain\Model\Commit::CLASS_RELEASE: $this->commitCountRelease++; break; case \Mrimann\CoMo\Domain\Model\Commit::CLASS_DOCUMENTATION: $this->commitCountDocumentation++; break; case \Mrimann\CoMo\Domain\Model\Commit::CLASS_TASK: $this->commitCountTask++; break; case \Mrimann\CoMo\Domain\Model\Commit::CLASS_BUGFIX: $this->commitCountBugfix++; break; case \Mrimann\CoMo\Domain\Model\Commit::CLASS_TEST: $this->commitCountTest++; break; case \Mrimann\CoMo\Domain\Model\Commit::CLASS_UNKNOWN: // fallthrough intended! // fallthrough intended! default: $this->commitCountUnknown++; break; } }