fix unittests for FroxlorRPC-class round #3 (maybe)

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-02-25 15:51:26 +01:00
parent 5d7649a274
commit 01798650fe
3 changed files with 5 additions and 5 deletions

View File

@@ -545,6 +545,6 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
return $this->response(true);
}
return $this->response(null, 204);
return $this->response(true, 304);
}
}

View File

@@ -929,7 +929,7 @@ class DomainZonesTest extends TestCase
$json_result = DomainZones::getLocal($customer_userdata, $data)->delete();
$result = json_decode($json_result, true);
$this->assertTrue($result['data']);
$this->assertEquals(200, $result['status']);
$this->assertEquals(200, http_response_code());
}
public function testCustomerDomainZonesDeleteUnmodified()
@@ -949,6 +949,6 @@ class DomainZonesTest extends TestCase
$json_result = DomainZones::getLocal($customer_userdata, $data)->delete();
$result = json_decode($json_result, true);
$this->assertTrue($result['data']);
$this->assertEquals(304, $result['status']);
$this->assertEquals(304, http_response_code());
}
}

View File

@@ -60,7 +60,7 @@ class FroxlorRpcTest extends TestCase
public function testNoCommandGiven()
{
$this->expectExceptionCode(400);
$this->expectExceptionMessage("No command given");
$this->expectExceptionMessage("Please provide a command.");
$_SERVER['PHP_AUTH_USER'] = 'test';
$_SERVER['PHP_AUTH_PW'] = 'test';
FroxlorRPC::validateRequest(json_encode(['cmd' => 'test']));
@@ -69,7 +69,7 @@ class FroxlorRpcTest extends TestCase
public function testInvalidCommandGiven()
{
$this->expectExceptionCode(400);
$this->expectExceptionMessage("Invalid command");
$this->expectExceptionMessage("The given command is invalid.");
$_SERVER['PHP_AUTH_USER'] = 'test';
$_SERVER['PHP_AUTH_PW'] = 'test';
FroxlorRPC::validateRequest(json_encode(['command' => 'Froxlor']));