summaryrefslogtreecommitdiffstats
path: root/tests/core/avatar/avatarcontrollertest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/core/avatar/avatarcontrollertest.php')
-rw-r--r--tests/core/avatar/avatarcontrollertest.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/core/avatar/avatarcontrollertest.php b/tests/core/avatar/avatarcontrollertest.php
index 7f69ba0aadb..9e46e1782af 100644
--- a/tests/core/avatar/avatarcontrollertest.php
+++ b/tests/core/avatar/avatarcontrollertest.php
@@ -324,6 +324,23 @@ class AvatarControllerTest extends \Test\TestCase {
}
/**
+ * Test posting avatar from existing folder
+ */
+ public function testPostAvatarFromNoFile() {
+ $file = $this->getMock('OCP\Files\Node');
+ $this->container['UserFolder']
+ ->method('get')
+ ->with('folder')
+ ->willReturn($file);
+
+ //Create request return
+ $response = $this->avatarController->postAvatar('folder');
+
+ //On correct upload always respond with the notsquare message
+ $this->assertEquals(['data' => ['message' => 'Please select a file.']], $response->getData());
+ }
+
+ /**
* Test what happens if the upload of the avatar fails
*/
public function testPostAvatarException() {