getHeader(); $footerReflection = new ReflectionProperty(ResponseRenderer::class, 'footer'); $footerReflection->setAccessible(true); $footer = $footerReflection->getValue($response); $this->assertInstanceOf(Footer::class, $footer); $headerIsAjax = new ReflectionProperty(Header::class, 'isAjax'); $headerIsAjax->setAccessible(true); $footerIsAjax = new ReflectionProperty(Footer::class, 'isAjax'); $footerIsAjax->setAccessible(true); $this->assertFalse($response->isAjax()); $this->assertFalse($headerIsAjax->getValue($header)); $this->assertFalse($footerIsAjax->getValue($footer)); $response->setAjax(true); $this->assertTrue($response->isAjax()); $this->assertTrue($headerIsAjax->getValue($header)); $this->assertTrue($footerIsAjax->getValue($footer)); $response->setAjax(false); $this->assertFalse($response->isAjax()); $this->assertFalse($headerIsAjax->getValue($header)); $this->assertFalse($footerIsAjax->getValue($footer)); } }