aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/AppFramework/Controller/OCSControllerTest.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-02-23 10:40:58 +0100
committerJoas Schilling <coding@schilljs.com>2022-02-23 11:01:58 +0100
commitd078d536835fc75a79b5381a628cefb92ae74886 (patch)
tree65dac66485b3562fa04f8fce4fabcac69a36ce74 /tests/lib/AppFramework/Controller/OCSControllerTest.php
parentcc6653e45c86e8019846274b04154c96e34632cf (diff)
downloadnextcloud-server-d078d536835fc75a79b5381a628cefb92ae74886.tar.gz
nextcloud-server-d078d536835fc75a79b5381a628cefb92ae74886.zip
Fix tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/lib/AppFramework/Controller/OCSControllerTest.php')
-rw-r--r--tests/lib/AppFramework/Controller/OCSControllerTest.php42
1 files changed, 11 insertions, 31 deletions
diff --git a/tests/lib/AppFramework/Controller/OCSControllerTest.php b/tests/lib/AppFramework/Controller/OCSControllerTest.php
index 91a61047871..ce110f435ef 100644
--- a/tests/lib/AppFramework/Controller/OCSControllerTest.php
+++ b/tests/lib/AppFramework/Controller/OCSControllerTest.php
@@ -28,7 +28,7 @@ use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Http\EmptyContentSecurityPolicy;
use OCP\AppFramework\OCSController;
use OCP\IConfig;
-use OCP\Security\ISecureRandom;
+use OCP\IRequestId;
class ChildOCSController extends OCSController {
}
@@ -42,12 +42,8 @@ class OCSControllerTest extends \Test\TestCase {
'HTTP_ORIGIN' => 'test',
],
],
- $this->getMockBuilder(ISecureRandom::class)
- ->disableOriginalConstructor()
- ->getMock(),
- $this->getMockBuilder(IConfig::class)
- ->disableOriginalConstructor()
- ->getMock()
+ $this->createMock(IRequestId::class),
+ $this->createMock(IConfig::class)
);
$controller = new ChildOCSController('app', $request, 'verbs',
'headers', 100);
@@ -67,12 +63,8 @@ class OCSControllerTest extends \Test\TestCase {
public function testXML() {
$controller = new ChildOCSController('app', new Request(
[],
- $this->getMockBuilder(ISecureRandom::class)
- ->disableOriginalConstructor()
- ->getMock(),
- $this->getMockBuilder(IConfig::class)
- ->disableOriginalConstructor()
- ->getMock()
+ $this->createMock(IRequestId::class),
+ $this->createMock(IConfig::class)
));
$controller->setOCSVersion(1);
@@ -100,12 +92,8 @@ class OCSControllerTest extends \Test\TestCase {
public function testJSON() {
$controller = new ChildOCSController('app', new Request(
[],
- $this->getMockBuilder(ISecureRandom::class)
- ->disableOriginalConstructor()
- ->getMock(),
- $this->getMockBuilder(IConfig::class)
- ->disableOriginalConstructor()
- ->getMock()
+ $this->createMock(IRequestId::class),
+ $this->createMock(IConfig::class)
));
$controller->setOCSVersion(1);
$expected = '{"ocs":{"meta":{"status":"ok","statuscode":100,"message":"OK",' .
@@ -121,12 +109,8 @@ class OCSControllerTest extends \Test\TestCase {
public function testXMLV2() {
$controller = new ChildOCSController('app', new Request(
[],
- $this->getMockBuilder(ISecureRandom::class)
- ->disableOriginalConstructor()
- ->getMock(),
- $this->getMockBuilder(IConfig::class)
- ->disableOriginalConstructor()
- ->getMock()
+ $this->createMock(IRequestId::class),
+ $this->createMock(IConfig::class)
));
$controller->setOCSVersion(2);
@@ -152,12 +136,8 @@ class OCSControllerTest extends \Test\TestCase {
public function testJSONV2() {
$controller = new ChildOCSController('app', new Request(
[],
- $this->getMockBuilder(ISecureRandom::class)
- ->disableOriginalConstructor()
- ->getMock(),
- $this->getMockBuilder(IConfig::class)
- ->disableOriginalConstructor()
- ->getMock()
+ $this->createMock(IRequestId::class),
+ $this->createMock(IConfig::class)
));
$controller->setOCSVersion(2);
$expected = '{"ocs":{"meta":{"status":"ok","statuscode":200,"message":"OK"},"data":{"test":"hi"}}}';