diff options
author | Olivier Paroz <github@oparoz.com> | 2015-08-23 05:11:28 +0300 |
---|---|---|
committer | Olivier Paroz <github@oparoz.com> | 2015-08-23 05:11:28 +0300 |
commit | 468f17a74a127ae7e2a4f9e2f1d0e57337595569 (patch) | |
tree | 8e1d2283322e5a534ab7809a3319e21d2cda2de3 /tests/integration | |
parent | 55f7c9e7de58dbed8fc3ea7709efbaeaee99eefa (diff) |
Some unit tests for the Environment class
Diffstat (limited to 'tests/integration')
-rw-r--r-- | tests/integration/environment/EnvironmentSetupTest.php (renamed from tests/integration/environment/EnvironmentTest.php) | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/tests/integration/environment/EnvironmentTest.php b/tests/integration/environment/EnvironmentSetupTest.php index b50f8945..0060f132 100644 --- a/tests/integration/environment/EnvironmentTest.php +++ b/tests/integration/environment/EnvironmentSetupTest.php @@ -18,11 +18,11 @@ use OCP\Files\Node; use OCA\Gallery\Tests\Integration\GalleryIntegrationTest; /** - * Class EnvironmentTest + * Class EnvironmentSetupTest * * @package OCA\Gallery\Tests\Integration */ -class EnvironmentTest extends GalleryIntegrationTest { +class EnvironmentSetupTest extends GalleryIntegrationTest { /** * Tests is setting up the environment using a normal user works @@ -65,15 +65,24 @@ class EnvironmentTest extends GalleryIntegrationTest { $this->assertEquals($sharedFolderId, $result->getId()); } + public function testGetSharedNodeAsATokenUserWhenGivenFileToken() { + $environment = $this->setTokenBasedEnv($this->sharedFileToken); + + $sharedFileId = $this->sharedFile->getId(); + $result = $environment->getSharedNode(); + + $this->assertEquals($sharedFileId, $result->getId()); + } + /** - * We can't get the folder if we're given a file token + * We can't get the virtual root if we're given a file token * - * @expects EnvironmentException + * @expectedException \OCA\Gallery\Environment\NotFoundEnvException */ - public function testGetSharedNodeAsATokenUserWhenGivenFileToken() { + public function testGetVirtualRootFolderAsATokenUserWhenGivenFileToken() { $environment = $this->setTokenBasedEnv($this->sharedFileToken); - $environment->getSharedNode(); + $environment->getVirtualRootFolder(); } public function testGetVirtualRootFolderAsALoggedInUser() { |