From 82cd86a2079c515df5889648c828c29e51424dab Mon Sep 17 00:00:00 2001 From: VicDeo Date: Thu, 8 Sep 2016 22:54:14 +0300 Subject: Allow one more origin. Log the reason of occ controller failure (#26031) * Log the reason of occ controller failure * Allow requests from SERVER_ADDR --- tests/Core/Controller/OccControllerTest.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/Core/Controller/OccControllerTest.php b/tests/Core/Controller/OccControllerTest.php index 682d9170096..46221d68b54 100644 --- a/tests/Core/Controller/OccControllerTest.php +++ b/tests/Core/Controller/OccControllerTest.php @@ -46,7 +46,8 @@ class OccControllerTest extends TestCase { private $console; public function testFromInvalidLocation(){ - $this->getControllerMock('example.org'); + $fakeHost = 'example.org'; + $this->getControllerMock($fakeHost); $response = $this->controller->execute('status', ''); $responseData = $response->getData(); @@ -55,7 +56,7 @@ class OccControllerTest extends TestCase { $this->assertEquals(126, $responseData['exitCode']); $this->assertArrayHasKey('details', $responseData); - $this->assertEquals('Web executor is not allowed to run from a different host', $responseData['details']); + $this->assertEquals('Web executor is not allowed to run from a host ' . $fakeHost, $responseData['details']); } public function testNotWhiteListedCommand(){ @@ -136,7 +137,10 @@ class OccControllerTest extends TestCase { 'core', $this->request, $this->config, - $this->console + $this->console, + $this->getMockBuilder('\OCP\ILogger') + ->disableOriginalConstructor() + ->getMock() ); } -- cgit v1.2.3