diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-08-08 23:15:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-08 23:15:06 +0200 |
commit | cb44bfe2b78c1f7e4adbdc7f8df8be2bd6501900 (patch) | |
tree | 908456d4c2e90540b4da7013b5639b02f8c14d43 /tests/lib/AppFramework | |
parent | a858c73357587722815cafbac6dbee0812679d83 (diff) | |
parent | 0032a5c2d1e43e9b355b887f15e3caee17048d6e (diff) | |
download | nextcloud-server-cb44bfe2b78c1f7e4adbdc7f8df8be2bd6501900.tar.gz nextcloud-server-cb44bfe2b78c1f7e4adbdc7f8df8be2bd6501900.zip |
Merge pull request #774 from nextcloud/di_core_settings
Hanlde Core and Settings app in AppFramework
Diffstat (limited to 'tests/lib/AppFramework')
-rw-r--r-- | tests/lib/AppFramework/AppTest.php | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/lib/AppFramework/AppTest.php b/tests/lib/AppFramework/AppTest.php index 7288e686d52..92ebd1f81e7 100644 --- a/tests/lib/AppFramework/AppTest.php +++ b/tests/lib/AppFramework/AppTest.php @@ -162,4 +162,55 @@ class AppTest extends \Test\TestCase { App::main($this->controllerName, $this->controllerMethod, $this->container, []); } + public function testCoreApp() { + $this->container['AppName'] = 'core'; + $this->container['OC\Core\Controller\Foo'] = $this->controller; + + $return = array(null, array(), array(), null, new Response()); + $this->dispatcher->expects($this->once()) + ->method('dispatch') + ->with($this->equalTo($this->controller), + $this->equalTo($this->controllerMethod)) + ->will($this->returnValue($return)); + + $this->io->expects($this->never()) + ->method('setOutput'); + + App::main('Foo', $this->controllerMethod, $this->container); + } + + public function testSettingsApp() { + $this->container['AppName'] = 'settings'; + $this->container['OC\Settings\Controller\Foo'] = $this->controller; + + $return = array(null, array(), array(), null, new Response()); + $this->dispatcher->expects($this->once()) + ->method('dispatch') + ->with($this->equalTo($this->controller), + $this->equalTo($this->controllerMethod)) + ->will($this->returnValue($return)); + + $this->io->expects($this->never()) + ->method('setOutput'); + + App::main('Foo', $this->controllerMethod, $this->container); + } + + public function testApp() { + $this->container['AppName'] = 'bar'; + $this->container['OCA\Bar\Controller\Foo'] = $this->controller; + + $return = array(null, array(), array(), null, new Response()); + $this->dispatcher->expects($this->once()) + ->method('dispatch') + ->with($this->equalTo($this->controller), + $this->equalTo($this->controllerMethod)) + ->will($this->returnValue($return)); + + $this->io->expects($this->never()) + ->method('setOutput'); + + App::main('Foo', $this->controllerMethod, $this->container); + } + } |