aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/AppFramework/Http/DispatcherTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/AppFramework/Http/DispatcherTest.php')
-rw-r--r--tests/lib/AppFramework/Http/DispatcherTest.php49
1 files changed, 13 insertions, 36 deletions
diff --git a/tests/lib/AppFramework/Http/DispatcherTest.php b/tests/lib/AppFramework/Http/DispatcherTest.php
index 92b772dbe31..56559623e53 100644
--- a/tests/lib/AppFramework/Http/DispatcherTest.php
+++ b/tests/lib/AppFramework/Http/DispatcherTest.php
@@ -36,6 +36,7 @@ use OCP\IConfig;
use OCP\IRequest;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
+use OCP\IRequestId;
class TestController extends Controller {
/**
@@ -309,12 +310,8 @@ class DispatcherTest extends \Test\TestCase {
],
'method' => 'POST'
],
- $this->getMockBuilder('\OCP\Security\ISecureRandom')
- ->disableOriginalConstructor()
- ->getMock(),
- $this->getMockBuilder(IConfig::class)
- ->disableOriginalConstructor()
- ->getMock()
+ $this->createMock(IRequestId::class),
+ $this->createMock(IConfig::class)
);
$this->dispatcher = new Dispatcher(
$this->http, $this->middlewareDispatcher, $this->reflector,
@@ -343,12 +340,8 @@ class DispatcherTest extends \Test\TestCase {
],
'method' => 'POST',
],
- $this->getMockBuilder('\OCP\Security\ISecureRandom')
- ->disableOriginalConstructor()
- ->getMock(),
- $this->getMockBuilder(IConfig::class)
- ->disableOriginalConstructor()
- ->getMock()
+ $this->createMock(IRequestId::class),
+ $this->createMock(IConfig::class)
);
$this->dispatcher = new Dispatcher(
$this->http, $this->middlewareDispatcher, $this->reflector,
@@ -380,12 +373,8 @@ class DispatcherTest extends \Test\TestCase {
],
'method' => 'GET'
],
- $this->getMockBuilder('\OCP\Security\ISecureRandom')
- ->disableOriginalConstructor()
- ->getMock(),
- $this->getMockBuilder(IConfig::class)
- ->disableOriginalConstructor()
- ->getMock()
+ $this->createMock(IRequestId::class),
+ $this->createMock(IConfig::class)
);
$this->dispatcher = new Dispatcher(
$this->http, $this->middlewareDispatcher, $this->reflector,
@@ -416,12 +405,8 @@ class DispatcherTest extends \Test\TestCase {
],
'method' => 'GET'
],
- $this->getMockBuilder('\OCP\Security\ISecureRandom')
- ->disableOriginalConstructor()
- ->getMock(),
- $this->getMockBuilder(IConfig::class)
- ->disableOriginalConstructor()
- ->getMock()
+ $this->createMock(IRequestId::class),
+ $this->createMock(IConfig::class)
);
$this->dispatcher = new Dispatcher(
$this->http, $this->middlewareDispatcher, $this->reflector,
@@ -453,12 +438,8 @@ class DispatcherTest extends \Test\TestCase {
],
'method' => 'PUT'
],
- $this->getMockBuilder('\OCP\Security\ISecureRandom')
- ->disableOriginalConstructor()
- ->getMock(),
- $this->getMockBuilder(IConfig::class)
- ->disableOriginalConstructor()
- ->getMock()
+ $this->createMock(IRequestId::class),
+ $this->createMock(IConfig::class)
);
$this->dispatcher = new Dispatcher(
$this->http, $this->middlewareDispatcher, $this->reflector,
@@ -492,12 +473,8 @@ class DispatcherTest extends \Test\TestCase {
],
'method' => 'POST'
],
- $this->getMockBuilder('\OCP\Security\ISecureRandom')
- ->disableOriginalConstructor()
- ->getMock(),
- $this->getMockBuilder(IConfig::class)
- ->disableOriginalConstructor()
- ->getMock()
+ $this->createMock(IRequestId::class),
+ $this->createMock(IConfig::class)
);
$this->dispatcher = new Dispatcher(
$this->http, $this->middlewareDispatcher, $this->reflector,