Example #1
0
 public function testUpdateStorageNonExisting()
 {
     $authMech = $this->getAuthMechMock();
     $authMech->method('validateStorage')->willReturn(true);
     $backend = $this->getBackendMock();
     $backend->method('validateStorage')->willReturn(true);
     $backend->method('isVisibleFor')->willReturn(true);
     $storageConfig = new StorageConfig(255);
     $storageConfig->setMountPoint('mount');
     $storageConfig->setBackend($backend);
     $storageConfig->setAuthMechanism($authMech);
     $storageConfig->setBackendOptions([]);
     $this->service->expects($this->once())->method('createStorage')->will($this->returnValue($storageConfig));
     $this->service->expects($this->once())->method('updateStorage')->will($this->throwException(new NotFoundException()));
     $response = $this->controller->update(255, 'mount', '\\OC\\Files\\Storage\\SMB', '\\OCA\\Files_External\\Lib\\Auth\\NullMechanism', array(), [], [], [], null);
     $this->assertEquals(Http::STATUS_NOT_FOUND, $response->getStatus());
 }
Example #2
0
 public function testUpdateStorageNonExisting()
 {
     $this->service->expects($this->once())->method('updateStorage')->will($this->throwException(new NotFoundException()));
     $response = $this->controller->update(255, 'mount', '\\OC\\Files\\Storage\\SMB', array(), [], [], [], null);
     $this->assertEquals(Http::STATUS_NOT_FOUND, $response->getStatus());
 }