public function testChainability() { $params = array('hi' => 'yo'); $this->tpl->setParams($params)->setStatus(Http::STATUS_NOT_FOUND); $this->assertEquals(Http::STATUS_NOT_FOUND, $this->tpl->getStatus()); $this->assertEquals(array('hi' => 'yo'), $this->tpl->getParams()); }
public function testPublicIndexWithFolderToken() { $token = 'aaaabbbbccccdddd'; $password = '******'; $displayName = 'User X'; $albumName = 'My Shared Folder'; $protected = 'true'; $server2ServerSharing = true; $server2ServerSharingEnabled = 'yes'; $params = ['appName' => $this->appName, 'token' => $token, 'displayName' => $displayName, 'albumName' => $albumName, 'server2ServerSharing' => $server2ServerSharing, 'protected' => $protected, 'filename' => $albumName]; $this->mockGetSharedNode('dir', 12345); $this->mockGetSharedFolderName($albumName); $this->mockGetDisplayName($displayName); $this->mockGetSharePassword($password); $this->mockGetAppValue($server2ServerSharingEnabled); $template = new TemplateResponse($this->appName, 'public', $params, 'public'); $response = $this->controller->publicIndex($token, null); $this->assertEquals($params, $response->getParams()); $this->assertEquals('public', $response->getTemplateName()); $this->assertTrue($response instanceof TemplateResponse); $this->assertEquals($template->getStatus(), $response->getStatus()); }