Skip to content

Commit

Permalink
fixed phpunit-coverage message & rule if it is increased higher=better!
Browse files Browse the repository at this point in the history
  • Loading branch information
kuehnmat authored and corpsee committed Aug 7, 2019
1 parent c4ca27b commit 7b63bd3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Plugin/BitbucketNotify.php
Expand Up @@ -312,7 +312,7 @@ public function getPhpUnitCoverage($targetBranch)
);
$currentBranchCoverage = json_decode($currentMetaData->getMetaValue(), true);

return new BitbucketNotifyPluginResult(
return new Plugin\Util\BitbucketNotifyPhpUnitResult(
PhpUnit::pluginName() . '-coverage',
isset($targetBranchCoverage['lines']) ? $targetBranchCoverage['lines'] : 0,
isset($currentBranchCoverage['lines']) ? $currentBranchCoverage['lines'] : 0
Expand Down
16 changes: 16 additions & 0 deletions src/Plugin/Util/BitbucketNotifyPhpUnitResult.php
@@ -0,0 +1,16 @@
<?php

namespace PHPCensor\Plugin\Util;

class BitbucketNotifyPhpUnitResult extends BitbucketNotifyPluginResult
{
public function isImproved()
{
return $this->right > $this->left;
}

public function isDegraded()
{
return $this->right < $this->left;
}
}

0 comments on commit 7b63bd3

Please sign in to comment.