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