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 // ----------------------------------------------------------------------------- trait MockInjectionTrait { public function __get($key) { return $this->$key; } public function __set($key, $value) { $this->$key = $value; return $this; } } class MockBaseApiModel extends BaseApiModel { use MockInjectionTrait; protected $base_url = 'https://httpbin.org/'; } class TestAnimeModel extends AnimeModel { use MockInjectionTrait; } class TestMangaModel extends MangaModel { use MockInjectionTrait; public function get_cached_image($api_path, $series_slug, $type = "anime") { return "/public/images/{$type}/{$series_slug}.jpg"; } protected function _check_cache($response) { $file = __DIR__ . '/test_data/manga_list/manga-transformed.json'; return Json::decodeFile($file); } } // End of mocks.php