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
359adf1
commit 5777d03
Showing
2 changed files
with
43 additions
and
0 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,42 @@ | ||
<?php | ||
|
||
require_once __DIR__.'/../vendor/autoload.php'; | ||
use edsonmedina\php_testability\AbstractIssue; | ||
use PhpParser\Node\Expr\Exit_; | ||
|
||
class AbstractIssueTest extends PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @covers edsonmedina\php_testability\AbstractIssue::__construct | ||
*/ | ||
public function testConstructor () | ||
{ | ||
$node = $this->getMockBuilder('PhpParser\Node\Expr\StaticCall') | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
|
||
$issue = $this->getMockBuilder('edsonmedina\php_testability\AbstractIssue') | ||
->setConstructorArgs(array($node)) | ||
->getMockForAbstractClass(); | ||
|
||
$this->assertAttributeEquals($node, 'node', $issue); | ||
} | ||
|
||
/** | ||
* @covers edsonmedina\php_testability\AbstractIssue::getLine | ||
*/ | ||
public function testGetLine () | ||
{ | ||
$node = $this->getMockBuilder('PhpParser\Node\Expr\StaticCall') | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
|
||
$node->method('getLine')->willReturn (123); | ||
|
||
$issue = $this->getMockBuilder('edsonmedina\php_testability\AbstractIssue') | ||
->setConstructorArgs(array($node)) | ||
->getMockForAbstractClass(); | ||
|
||
$this->assertEquals (123, $issue->getLine()); | ||
} | ||
} |