/** * @covers Paradox\pod\Document::setSaved */ public function testSetSaved() { //First we need to create a ReflectionClass object //passing in the class name as a variable $reflectionClass = new \ReflectionClass('Paradox\\pod\\Document'); //Then we need to get the property we wish to test //and make it accessible $new = $reflectionClass->getProperty('_new'); $new->setAccessible(true); $changed = $reflectionClass->getProperty('_changed'); $changed->setAccessible(true); $this->document->setSaved(); $this->assertFalse($new->getValue($this->document), "The document should not be marked as new"); $this->assertFalse($changed->getValue($this->document), "The document should not be marked as changed"); }