summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-04-27 17:14:52 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-05-04 10:46:10 +0200
commitb1a9e26c453316ef27915bfedf2f1435cd443952 (patch)
treedfc8b83a143938175894051aac0577fdf61ff218
parent3dbe7e195c225fd0b322c594d724971641847f15 (diff)
downloadnextcloud-server-b1a9e26c453316ef27915bfedf2f1435cd443952.tar.gz
nextcloud-server-b1a9e26c453316ef27915bfedf2f1435cd443952.zip
check the called URL
-rw-r--r--apps/files_sharing/tests/external/managertest.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/apps/files_sharing/tests/external/managertest.php b/apps/files_sharing/tests/external/managertest.php
index 4158b1bf445..3a88c78220f 100644
--- a/apps/files_sharing/tests/external/managertest.php
+++ b/apps/files_sharing/tests/external/managertest.php
@@ -23,16 +23,20 @@
namespace OCA\Files_Sharing\Tests\External;
use OC\Files\Storage\StorageFactory;
+use OCA\Files_Sharing\External\Manager;
use OCA\Files_Sharing\Tests\TestCase;
class ManagerTest extends TestCase {
- /** @var \OCA\Files_Sharing\External\Manager **/
+ /** @var Manager **/
private $manager;
/** @var \OC\Files\Mount\Manager */
private $mountManager;
+ /** @var \PHPUnit_Framework_MockObject_MockObject */
+ private $httpHelper;
+
private $uid;
protected function setUp() {
@@ -40,16 +44,22 @@ class ManagerTest extends TestCase {
$this->uid = $this->getUniqueID('user');
$this->mountManager = new \OC\Files\Mount\Manager();
- $this->manager = new \OCA\Files_Sharing\External\Manager(
+ $this->httpHelper = $httpHelper = $this->getMockBuilder('\OC\HTTPHelper')->disableOriginalConstructor()->getMock();
+ /** @var \OC\HTTPHelper $httpHelper */
+ $this->manager = new Manager(
\OC::$server->getDatabaseConnection(),
$this->mountManager,
new StorageFactory(),
- $this->getMockBuilder('\OC\HTTPHelper')->disableOriginalConstructor()->getMock(),
+ $httpHelper,
$this->uid
);
}
public function testAddShare() {
+ $this->httpHelper->expects($this->exactly(4))
+ ->method('post')
+ ->with($this->stringStartsWith('http://localhost/ocs/v1.php/cloud/shares'), $this->anything());
+
$shareData1 = [
'remote' => 'http://localhost',
'token' => 'token1',