This repository has been archived by the owner on Aug 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad42166
commit 359adf1
Showing
5 changed files
with
217 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
require_once __DIR__.'/../../vendor/autoload.php'; | ||
|
||
use edsonmedina\php_testability\Issues\EmptyCatchIssue; | ||
|
||
class EmptyCatchIssueTest extends PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @covers edsonmedina\php_testability\Issues\EmptyCatchIssue::getTitle | ||
*/ | ||
public function testGetTitle () | ||
{ | ||
$node = $this->getMockBuilder('PhpParser\Node\Stmt\Catch_') | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
|
||
$issue = new EmptyCatchIssue ($node); | ||
|
||
$this->assertEquals('Empty catch block', $issue->getTitle()); | ||
} | ||
|
||
/** | ||
* @covers edsonmedina\php_testability\Issues\EmptyCatchIssue::getID | ||
*/ | ||
public function testGetID () | ||
{ | ||
$node = $this->getMockBuilder('PhpParser\Node\Stmt\Catch_') | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
|
||
$issue = new EmptyCatchIssue ($node); | ||
|
||
$this->assertEquals('', $issue->getID()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
require_once __DIR__.'/../../vendor/autoload.php'; | ||
|
||
use edsonmedina\php_testability\Issues\ErrorSuppressionIssue; | ||
|
||
class ErrorSuppressionIssueTest extends PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @covers edsonmedina\php_testability\Issues\ErrorSuppressionIssue::getTitle | ||
*/ | ||
public function testGetTitle () | ||
{ | ||
$node = $this->getMockBuilder('PhpParser\Node\Expr\ErrorSuppress') | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
|
||
$issue = new ErrorSuppressionIssue ($node); | ||
|
||
$this->assertEquals('Error suppression', $issue->getTitle()); | ||
} | ||
|
||
/** | ||
* @covers edsonmedina\php_testability\Issues\ErrorSuppressionIssue::getID | ||
*/ | ||
public function testGetID () | ||
{ | ||
$node = $this->getMockBuilder('PhpParser\Node\Expr\ErrorSuppress') | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
|
||
$issue = new ErrorSuppressionIssue ($node); | ||
|
||
$this->assertEquals('', $issue->getID()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
require_once __DIR__.'/../../vendor/autoload.php'; | ||
|
||
use edsonmedina\php_testability\Issues\ExitIssue; | ||
|
||
class ExitIssueTest extends PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @covers edsonmedina\php_testability\Issues\ExitIssue::getTitle | ||
*/ | ||
public function testGetTitle () | ||
{ | ||
$node = $this->getMockBuilder('PhpParser\Node\Expr\Exit_') | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
|
||
$issue = new ExitIssue ($node); | ||
|
||
$this->assertEquals('Exit', $issue->getTitle()); | ||
} | ||
|
||
/** | ||
* @covers edsonmedina\php_testability\Issues\ExitIssue::getID | ||
*/ | ||
public function testGetID () | ||
{ | ||
$node = $this->getMockBuilder('PhpParser\Node\Expr\Exit_') | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
|
||
$issue = new ExitIssue ($node); | ||
|
||
$this->assertEquals('', $issue->getID()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters