/** * @covers Paradox\Client::debug */ public function testDebug() { //First we need to create a ReflectionClass object //passing in the class name as a variable $reflectionClass = new \ReflectionClass('Paradox\\Client'); //Then we need to get the property we wish to test //and make it accessible $debugger = $reflectionClass->getProperty('_debug'); $debugger->setAccessible(true); $debugReflectionClass = new \ReflectionClass('Paradox\\Debug'); $debugValue = $debugReflectionClass->getProperty('_debug'); $debugValue->setAccessible(true); //Verify debug is initially false $debuggerInstance = $debugger->getValue($this->client); $this->assertFalse($debugValue->getValue($debuggerInstance), "The debugger value should be false"); //Set debug to true and verify $this->client->debug(true); $this->assertTrue($debugValue->getValue($debuggerInstance), "The debugger value should be true"); }