diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-04-27 17:14:52 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-04-28 11:28:54 +0200 |
commit | 66dca76f7272876ba19f85709f24e0457c90ca9d (patch) | |
tree | 80561a039c74ed643bd9ca08d613212a62476895 /apps | |
parent | 8f7c64253ed6f1165ede51d70c788160f3c26a91 (diff) | |
download | nextcloud-server-66dca76f7272876ba19f85709f24e0457c90ca9d.tar.gz nextcloud-server-66dca76f7272876ba19f85709f24e0457c90ca9d.zip |
check the called URL
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/tests/external/managertest.php | 16 |
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 3fd1f5444b2..af0f1880123 100644 --- a/apps/files_sharing/tests/external/managertest.php +++ b/apps/files_sharing/tests/external/managertest.php @@ -22,16 +22,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() { @@ -39,16 +43,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', |