mirror of
https://github.com/Karaka-Management/Build.git
synced 2026-02-12 09:08:40 +00:00
add invalid api function tests
This commit is contained in:
parent
333158e933
commit
92dabf580e
|
|
@ -25,15 +25,15 @@ function createFunction($name)
|
||||||
{
|
{
|
||||||
$invalid = <<<HEREDOC
|
$invalid = <<<HEREDOC
|
||||||
|
|
||||||
public function testInvalid{$name}() : void
|
public function testInvalid{$name}() : void
|
||||||
{
|
{
|
||||||
\$response = new HttpResponse();
|
\$response = new HttpResponse();
|
||||||
\$request = new HttpRequest(new HttpUri(''));
|
\$request = new HttpRequest(new HttpUri(''));
|
||||||
|
|
||||||
\$request->header->account = 1;
|
\$request->header->account = 1;
|
||||||
\$this->module->{$name}(\$request, \$response);
|
\$this->module->{$name}(\$request, \$response);
|
||||||
self::assertEquals(RequestStatusCode::R_400, \$response->header->status);
|
self::assertEquals(RequestStatusCode::R_400, \$response->header->status);
|
||||||
}
|
}
|
||||||
|
|
||||||
HEREDOC;
|
HEREDOC;
|
||||||
|
|
||||||
|
|
@ -136,7 +136,7 @@ foreach ($modules as $module) {
|
||||||
echo $function . "\n";
|
echo $function . "\n";
|
||||||
$newContent = \createFunction($function);
|
$newContent = \createFunction($function);
|
||||||
$newContent = \rtrim($testFile, " }\n") . "\n }\n" . $newContent . "}\n";
|
$newContent = \rtrim($testFile, " }\n") . "\n }\n" . $newContent . "}\n";
|
||||||
//\file_put_contents($path, $newContent);
|
\file_put_contents($path, $newContent);
|
||||||
$open[$function] = 1;
|
$open[$function] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -152,7 +152,7 @@ foreach ($modules as $module) {
|
||||||
echo $function . "\n";
|
echo $function . "\n";
|
||||||
$newContent = \createFunction($function);
|
$newContent = \createFunction($function);
|
||||||
$newContent = \rtrim($testFile, " }\n") . "\n }\n" . $newContent . "}\n";
|
$newContent = \rtrim($testFile, " }\n") . "\n }\n" . $newContent . "}\n";
|
||||||
//\file_put_contents($path, $newContent);
|
\file_put_contents($path, $newContent);
|
||||||
$open[$function] = 1;
|
$open[$function] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user