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 TestHtmlView extends HtmlView { use MockViewOutputTrait; } class TestHttpView extends HttpView { use MockViewOutputTrait; } class TestJsonView extends JsonView { public function __destruct() {} } // ----------------------------------------------------------------------------- // AnimeClient Mocks // ----------------------------------------------------------------------------- class MockBaseApiModel extends BaseApiModel { protected $base_url = 'https://httpbin.org/'; public function __get($key) { return $this->$key; } public function __set($key, $value) { $this->$key = $value; return $this; } } class TestAnimeModel extends AnimeModel { protected $transformed_data_file; public function __construct(ContainerInterface $container) { parent::__construct($container); $this->transformed_data_file = _dir( TEST_DATA_DIR, 'anime_list','anime-completed-transformed.json' ); } protected function _get_list_from_api($status="all") { $data = json_decode(file_get_contents($this->transformed_data_file), TRUE); return $data; } } // End of mocks.php