getProperties(); $props = []; foreach($properties as $reflectProp) { $reflectProp->setAccessible(TRUE); $props[$reflectProp->getName()] = $reflectProp->getValue($this); } $view = new TestView($this->container); $friend = new Friend($view); foreach($props as $name => $val) { $friend->__set($name, $val); } $friend->output(); } } class HtmlViewTest extends ViewTest { protected $template_path = __DIR__ . "/../../test_views/"; public function setUp() { parent::setUp(); $this->view = new TestHtmlView($this->container); } public function testRenderTemplate() { $path = $this->template_path . 'test_view.php'; $expected = 'foo'; $actual = $this->view->render_template($path, [ 'var' => 'foo' ]); $this->assertEquals($expected, $actual); } }