Skip to content

Commit

Permalink
Merge pull request #1 from peter279k/test_enhancement
Browse files Browse the repository at this point in the history
Test enhancement
  • Loading branch information
duncan3dc committed May 25, 2018
2 parents 85d27b2 + c3f8667 commit e87fdc7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/InheritanceTest.php
Expand Up @@ -3,8 +3,9 @@
namespace duncan3dc\ObjectIntruderTests;

use duncan3dc\ObjectIntruder\Intruder;
use PHPUnit\Framework\TestCase;

class InheritanceTest extends \PHPUnit_Framework_TestCase
class InheritanceTest extends TestCase
{
private $class;
private $intruder;
Expand Down
11 changes: 10 additions & 1 deletion tests/IntruderTest.php
Expand Up @@ -3,8 +3,9 @@
namespace duncan3dc\ObjectIntruderTests;

use duncan3dc\ObjectIntruder\Intruder;
use PHPUnit\Framework\TestCase;

class IntruderTest extends \PHPUnit_Framework_TestCase
class IntruderTest extends TestCase
{
private $class;
private $intruder;
Expand All @@ -16,6 +17,14 @@ public function setUp()
}


public function testConstructorOnInvalidObject()
{
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("Only objects can be intruded");
new Intruder('invalid_object');
}


public function testGetPublicProperty()
{
$this->assertSame("R2-D2", $this->intruder->publicProperty);
Expand Down

0 comments on commit e87fdc7

Please sign in to comment.