Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
ExceptionTest | n/a |
0 / 0 |
|
100.00% |
3 / 3 |
3 | n/a |
0 / 0 |
||
setUp | |
100.00% |
1 / 1 |
1 | n/a |
0 / 0 |
||||
testConstructor | |
100.00% |
1 / 1 |
1 | n/a |
0 / 0 |
||||
tearDown | |
100.00% |
1 / 1 |
1 | n/a |
0 / 0 |
<?php | |
namespace Test\Ease; | |
use Ease\Exception; | |
/** | |
* Generated by PHPUnit_SkeletonGenerator on 2016-12-29 at 21:56:53. | |
*/ | |
class ExceptionTest extends \PHPUnit_Framework_TestCase | |
{ | |
/** | |
* @var Exception | |
*/ | |
protected $object; | |
/** | |
* Sets up the fixture, for example, opens a network connection. | |
* This method is called before a test is executed. | |
*/ | |
protected function setUp() | |
{ | |
$this->object = new Exception('test'); | |
} | |
/** | |
* @expectedException \Ease\Exception | |
* @expectedExceptionMessage test | |
*/ | |
public function testConstructor() | |
{ | |
$classname = get_class($this->object); | |
// Get mock, without the constructor being called | |
$mock = $this->getMockBuilder($classname) | |
->disableOriginalConstructor() | |
->getMockForAbstractClass(); | |
$mock->__construct('test'); | |
throw new Exception('test'); | |
} | |
/** | |
* Tears down the fixture, for example, closes a network connection. | |
* This method is called after a test is executed. | |
*/ | |
protected function tearDown() | |
{ | |
} | |
} |