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(); }*/ public function send() { if ($this->hasRendered) { throw new DoubleRenderException(); } $this->hasRendered = TRUE; } } class TestView extends View { public function send() { if ($this->hasRendered) { throw new DoubleRenderException(); } $this->hasRendered = TRUE; } public function output() {} } class TestHtmlView extends HtmlView { protected function output() { if ($this->hasRendered) { throw new DoubleRenderException(); } $this->hasRendered = TRUE; } } class TestHttpView extends HttpView { protected function output() { if ($this->hasRendered) { throw new DoubleRenderException(); } $this->hasRendered = TRUE; } } class TestJsonView extends JsonView { public function __destruct() {} protected function output() { if ($this->hasRendered) { throw new DoubleRenderException(); } $this->hasRendered = TRUE; } } // ----------------------------------------------------------------------------- // AnimeClient Mocks // ----------------------------------------------------------------------------- trait MockInjectionTrait { public function __get($key) { return $this->$key; } public function __set($key, $value) { $this->$key = $value; return $this; } } // End of mocks.php