<?php class SampleClass { protected $foo = TRUE; protected function hoge() { return TRUE; } } <?php require_once 'SampleClass.php'; class SampleClassTest extends PHPUnit_Framework_TestCase { public function testAccessProtectedProperty() { $foo = self::getProperty('foo'); $obj = new SampleClass(); $this->assertTrue($foo->getValue($obj)); } public function testAccessProtectedMethod() { $foo = self::