23 private $internal = 1;
24 private function add($inc)
26 $this->
internal += $inc;
27 return $this->internal;
29 public function getInternal()
31 return $this->internal;
37 protected function setUp()
39 $this->assertCountBefore = \Hamcrest\MatcherAssert::getCount();
42 protected function tearDown()
44 $this->addToAssertionCount(\Hamcrest\MatcherAssert::getCount()-$this->assertCountBefore);
47 public function testInvokeObjectsMethodnameWith()
50 assertThat(Reflectory::invokeObjectsMethodnameWith($instanceWithPrivateMethod,
'add', array(2)),is(1+2));
51 assertThat(Reflectory::invokeObjectsMethodnameWith($instanceWithPrivateMethod,
'add', array(4)),is(1+2+4));
54 public function testGetObjectsProperty()
57 assertThat(Reflectory::getObjectsProperty($instanceWithPrivateMethod,
'internal'),is(1));
60 public function testSetObjectsProperty()
63 Reflectory::setObjectsProperty($instanceWithPrivateMethod,
'internal', 3);
64 assertThat($instanceWithPrivateMethod->getInternal(),is(3));