Пример #1
0
 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);
 }
 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
 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);
 }