public function processResponse($response)
 {
     if (LayoutModule::isDisabled()) {
         return $response;
     }
     if (!$response instanceof HtmlResponse) {
         return $response;
     }
     $className = LayoutModule::getLayoutClassName();
     if (!class_exists($className)) {
         throw new LayoutNotFoundException($className);
     }
     $layout = new $className();
     $layout->processResponse($response);
     return $response;
 }
 public function testLayoutCanBeChanged()
 {
     new LayoutModule("Rhubarb\\Crown\\Tests\\Layout\\TestLayout");
     LayoutModule::setLayoutClassName("Rhubarb\\Crown\\Tests\\Layout\\LayoutTest2");
     $this->assertEquals("Rhubarb\\Crown\\Tests\\Layout\\LayoutTest2", LayoutModule::getLayoutClassName());
 }
 public function testLayoutCanBeChanged()
 {
     new LayoutModule(TestLayout::class);
     LayoutModule::setLayoutClassName(TestLayout2::class);
     $this->assertEquals(TestLayout2::class, LayoutModule::getLayoutClassName());
 }