protected function checkAjaxForm($destination, $formName, $post = [], $path = FALSE) { if (is_string($path)) { $this->checkForm($destination, $formName, $post, $path); Assert::false($this->__testbench_presenter->isAjax()); } $this->__testbench_presenter = NULL; //FIXME: not very nice, but performance first $this->__testbench_ajaxMode = TRUE; $response = $this->check($destination, ['do' => $formName . '-submit'], $post); Assert::true($this->__testbench_presenter->isAjax()); if (!$this->__testbench_exception) { Assert::same(200, $this->getReturnCode()); Assert::type('Nette\\Application\\Responses\\JsonResponse', $response); } $this->__testbench_presenter = NULL; $this->__testbench_ajaxMode = FALSE; return $response; }