Example #1
0
 public function testComponentAjax()
 {
     Request::swap($this->configAjaxRequestMock('testArchive::onTestAjax', 'ajax-result'));
     $theme = Theme::load('test');
     $controller = new Controller($theme);
     $response = $controller->run('/with-component');
     $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $response);
     $content = $response->getOriginalContent();
     $this->assertInternalType('array', $content);
     $this->assertEquals(200, $response->getStatusCode());
     $this->assertCount(1, $content);
     $this->assertArrayHasKey('ajax-result', $content);
     $this->assertEquals('page', $content['ajax-result']);
 }