diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-11-05 12:16:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-05 12:16:36 +0100 |
commit | cba3883410f958305673f75950c5b6227c571f16 (patch) | |
tree | 50c627bd8a4d60daa8ae968e64c96b40509e39b7 /tests | |
parent | 934d08b2e8b0f6f8616882b9c08d1bec4db22eb2 (diff) | |
parent | c8cf98652730391dcab1e25494981a901c25ca8d (diff) | |
download | nextcloud-server-cba3883410f958305673f75950c5b6227c571f16.tar.gz nextcloud-server-cba3883410f958305673f75950c5b6227c571f16.zip |
Merge pull request #12185 from nextcloud/cleanup/dicontainer
Cleanup the DIContainer
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/AppFramework/AppTest.php | 15 | ||||
-rw-r--r-- | tests/lib/AppFramework/DependencyInjection/DIContainerTest.php | 9 |
2 files changed, 7 insertions, 17 deletions
diff --git a/tests/lib/AppFramework/AppTest.php b/tests/lib/AppFramework/AppTest.php index 93b8768e674..b31f4428777 100644 --- a/tests/lib/AppFramework/AppTest.php +++ b/tests/lib/AppFramework/AppTest.php @@ -25,6 +25,8 @@ namespace Test\AppFramework; use OC\AppFramework\App; +use OC\AppFramework\Http\Dispatcher; +use OCP\AppFramework\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\Response; @@ -60,16 +62,9 @@ class AppTest extends \Test\TestCase { parent::setUp(); $this->container = new \OC\AppFramework\DependencyInjection\DIContainer('test', array()); - $this->controller = $this->getMockBuilder( - 'OCP\AppFramework\Controller') - ->disableOriginalConstructor() - ->getMock(); - $this->dispatcher = $this->getMockBuilder( - 'OC\AppFramework\Http\Dispatcher') - ->disableOriginalConstructor() - ->getMock(); - - $this->io = $this->getMockBuilder('OCP\\AppFramework\\Http\\IOutput')->getMock(); + $this->controller = $this->createMock(Controller::class); + $this->dispatcher = $this->createMock(Dispatcher::class); + $this->io = $this->createMock(Http\IOutput::class); $this->headers = array('key' => 'value'); $this->output = 'hi'; diff --git a/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php b/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php index d4581aaaf23..5f089e96018 100644 --- a/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php +++ b/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php @@ -40,7 +40,6 @@ class DIContainerTest extends \Test\TestCase { /** @var DIContainer|\PHPUnit_Framework_MockObject_MockObject */ private $container; - private $api; protected function setUp(){ parent::setUp(); @@ -78,12 +77,8 @@ class DIContainerTest extends \Test\TestCase { public function testMiddlewareDispatcherIncludesSecurityMiddleware(){ $this->container['Request'] = new Request( ['method' => 'GET'], - $this->getMockBuilder(ISecureRandom::class) - ->disableOriginalConstructor() - ->getMock(), - $this->getMockBuilder(IConfig::class) - ->disableOriginalConstructor() - ->getMock() + $this->createMock(ISecureRandom::class), + $this->createMock(IConfig::class) ); $security = $this->container['SecurityMiddleware']; $dispatcher = $this->container['MiddlewareDispatcher']; |