request = $this->getMockBuilder('OCP\IRequest') ->disableOriginalConstructor() ->getMock(); $this->importManager = $this->getMockBuilder('\OCA\Contacts\ImportManager') ->disableOriginalConstructor() ->getMock(); $this->utilFactory = $this->getMockBuilder('\OCA\Contacts\Factory\UtilFactory') ->disableOriginalConstructor() ->getMock(); $this->appName = 'contacts'; $this->controller = new PageController( $this->appName, $this->request, $this->importManager, $this->utilFactory ); } public function testIndex() { $expected = new TemplateResponse($this->appName, 'contacts'); $expected->setParams([ 'uploadMaxFilesize' => null, 'uploadMaxHumanFilesize' => null, 'phoneTypes' => [ 'HOME' => 'Home', 'CELL' => 'Mobile', 'WORK' => 'Work', 'TEXT' => 'Text', 'VOICE' => 'Voice', 'MSG' => 'Message', 'FAX' => 'Fax', 'VIDEO' => 'Video', 'PAGER' => 'Pager', 'OTHER' => 'Other', ], 'emailTypes' => [ 'WORK' => 'Work', 'HOME' => 'Home', 'INTERNET' => 'Internet', 'OTHER' => 'Other', ], 'adrTypes' => [ 'WORK' => 'Work', 'HOME' => 'Home', 'OTHER' => 'Other', ], 'imppTypes' => [ 'WORK' => 'Work', 'HOME' => 'Home', 'OTHER' => 'Other', ], 'imProtocols' => [ 'jabber' => 'Jabber', 'sip' => 'Internet call', 'aim' => 'AIM', 'msn' => 'MSN', 'twitter' => 'Twitter', 'googletalk' => 'GoogleTalk', 'facebook' => 'Facebook', 'xmpp' => 'XMPP', 'icq' => 'ICQ', 'yahoo' => 'Yahoo', 'skype' => 'Skype', 'qq' => 'QQ', 'gadugadu' => 'GaduGadu', 'owncloud-handle' => 'ownCloud', ], 'importManager' => $this->importManager, 'cloudTypes' => [ 'HOME' => 'Home', 'WORK' => 'Work', 'OTHER' => 'Other', ], ]); $this->assertEquals($expected, $this->controller->index()); } }