fix unittests for FroxlorRPC-class round #3 (maybe)
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -545,6 +545,6 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
|
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
|
||||||
return $this->response(true);
|
return $this->response(true);
|
||||||
}
|
}
|
||||||
return $this->response(null, 204);
|
return $this->response(true, 304);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -929,7 +929,7 @@ class DomainZonesTest extends TestCase
|
|||||||
$json_result = DomainZones::getLocal($customer_userdata, $data)->delete();
|
$json_result = DomainZones::getLocal($customer_userdata, $data)->delete();
|
||||||
$result = json_decode($json_result, true);
|
$result = json_decode($json_result, true);
|
||||||
$this->assertTrue($result['data']);
|
$this->assertTrue($result['data']);
|
||||||
$this->assertEquals(200, $result['status']);
|
$this->assertEquals(200, http_response_code());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCustomerDomainZonesDeleteUnmodified()
|
public function testCustomerDomainZonesDeleteUnmodified()
|
||||||
@@ -949,6 +949,6 @@ class DomainZonesTest extends TestCase
|
|||||||
$json_result = DomainZones::getLocal($customer_userdata, $data)->delete();
|
$json_result = DomainZones::getLocal($customer_userdata, $data)->delete();
|
||||||
$result = json_decode($json_result, true);
|
$result = json_decode($json_result, true);
|
||||||
$this->assertTrue($result['data']);
|
$this->assertTrue($result['data']);
|
||||||
$this->assertEquals(304, $result['status']);
|
$this->assertEquals(304, http_response_code());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class FroxlorRpcTest extends TestCase
|
|||||||
public function testNoCommandGiven()
|
public function testNoCommandGiven()
|
||||||
{
|
{
|
||||||
$this->expectExceptionCode(400);
|
$this->expectExceptionCode(400);
|
||||||
$this->expectExceptionMessage("No command given");
|
$this->expectExceptionMessage("Please provide a command.");
|
||||||
$_SERVER['PHP_AUTH_USER'] = 'test';
|
$_SERVER['PHP_AUTH_USER'] = 'test';
|
||||||
$_SERVER['PHP_AUTH_PW'] = 'test';
|
$_SERVER['PHP_AUTH_PW'] = 'test';
|
||||||
FroxlorRPC::validateRequest(json_encode(['cmd' => 'test']));
|
FroxlorRPC::validateRequest(json_encode(['cmd' => 'test']));
|
||||||
@@ -69,7 +69,7 @@ class FroxlorRpcTest extends TestCase
|
|||||||
public function testInvalidCommandGiven()
|
public function testInvalidCommandGiven()
|
||||||
{
|
{
|
||||||
$this->expectExceptionCode(400);
|
$this->expectExceptionCode(400);
|
||||||
$this->expectExceptionMessage("Invalid command");
|
$this->expectExceptionMessage("The given command is invalid.");
|
||||||
$_SERVER['PHP_AUTH_USER'] = 'test';
|
$_SERVER['PHP_AUTH_USER'] = 'test';
|
||||||
$_SERVER['PHP_AUTH_PW'] = 'test';
|
$_SERVER['PHP_AUTH_PW'] = 'test';
|
||||||
FroxlorRPC::validateRequest(json_encode(['command' => 'Froxlor']));
|
FroxlorRPC::validateRequest(json_encode(['command' => 'Froxlor']));
|
||||||
|
|||||||
Reference in New Issue
Block a user