Skip to content
Snippets Groups Projects
Commit 7eed8b73 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

adjusted the tests

parent 16a367d4
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,11 @@
*/
class ajax_requests_test extends DokuWikiTest {
/**
* DataProvider for the builtin Ajax calls
*
* @return array
*/
public function defaultCalls() {
return [
// TODO: better logic and DOM walks
......@@ -23,9 +28,11 @@ class ajax_requests_test extends DokuWikiTest {
];
}
/**
* @dataProvider defaultCalls
* @param string $call
* @param array $post
* @param string $regexp
*/
public function test_defaultCallsExist($call, $post, $regexp) {
......@@ -36,8 +43,6 @@ class ajax_requests_test extends DokuWikiTest {
if (!empty($regexp)) {
$this->assertRegExp($regexp, $response->getContent());
}
$this->assertTrue(function_exists('ajax_'.$call));
}
public function test_CallNotProvided() {
......@@ -51,7 +56,6 @@ class ajax_requests_test extends DokuWikiTest {
$request = new TestRequest();
$response = $request->post(['call'=> $call], '/lib/exe/ajax.php');
$this->assertEquals("AJAX call '$call' unknown!\n", $response->getContent());
$this->assertFalse(function_exists('ajax_'.$call));
}
......@@ -116,4 +120,4 @@ class ajax_requests_test extends DokuWikiTest {
$this->assertEquals("captured event BEFORE\ncaptured event AFTER", $response->getContent());
}
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment