コード例 #1
0
ファイル: activitiestest.php プロジェクト: AARNet/activity
 public function testFetch()
 {
     $this->data->expects($this->any())->method('read')->willReturn([]);
     $templateResponse = $this->controller->fetch(1);
     $this->assertTrue($templateResponse instanceof TemplateResponse, 'Asserting type of return is \\OCP\\AppFramework\\Http\\TemplateResponse');
     $renderedResponse = $templateResponse->render();
     $this->assertEmpty($renderedResponse);
 }
コード例 #2
0
 public function testShowList()
 {
     $template = new Template('activity', 'stream.app.navigation', '');
     $template->assign('activeNavigation', 'all');
     $template->assign('navigations', []);
     $template->assign('rssLink', '');
     $this->navigation->expects($this->any())->method('getTemplate')->willReturn($template);
     $templateResponse = $this->controller->showList();
     $this->assertInstanceOf('\\OCP\\AppFramework\\Http\\TemplateResponse', $templateResponse, 'Asserting type of return is \\OCP\\AppFramework\\Http\\TemplateResponse');
     $renderedResponse = $templateResponse->render();
     $this->assertNotEmpty($renderedResponse);
 }
コード例 #3
0
ファイル: activitiestest.php プロジェクト: ynott/activity
 public function testShowList()
 {
     $template = new Template('activity', 'stream.app.navigation', '');
     $template->assign('activeNavigation', 'all');
     $template->assign('navigations', []);
     $template->assign('rssLink', '');
     $this->navigation->expects($this->any())->method('getTemplate')->willReturn($template);
     $avatar = $this->getMockBuilder('OCP\\IAvatar')->disableOriginalConstructor()->getMock();
     $this->avatarManager->expects($this->once())->method('getAvatar')->willReturn($avatar);
     $avatar->expects($this->once())->method('exists')->willReturn(false);
     $templateResponse = $this->controller->showList();
     $this->assertInstanceOf('\\OCP\\AppFramework\\Http\\TemplateResponse', $templateResponse, 'Asserting type of return is \\OCP\\AppFramework\\Http\\TemplateResponse');
     $renderedResponse = $templateResponse->render();
     $this->assertNotEmpty($renderedResponse);
 }