public function testGetStorage() { $storageConfig = new StorageConfig(1); $storageConfig->setMountPoint('test'); $storageConfig->setBackendClass('\\OC\\Files\\Storage\\SMB'); $storageConfig->setBackendOptions(['user' => 'test', 'password', 'password123']); $storageConfig->setMountOptions(['priority' => false]); $this->service->expects($this->once())->method('getStorage')->with(1)->will($this->returnValue($storageConfig)); $response = $this->controller->show(1); $this->assertEquals(Http::STATUS_OK, $response->getStatus()); $this->assertEquals($storageConfig, $response->getData()); }
public function testGetStorage() { $backend = $this->getBackendMock(); $authMech = $this->getAuthMechMock(); $storageConfig = new StorageConfig(1); $storageConfig->setMountPoint('test'); $storageConfig->setBackend($backend); $storageConfig->setAuthMechanism($authMech); $storageConfig->setBackendOptions(['user' => 'test', 'password', 'password123']); $storageConfig->setMountOptions(['priority' => false]); $this->service->expects($this->once())->method('getStorage')->with(1)->will($this->returnValue($storageConfig)); $response = $this->controller->show(1); $this->assertEquals(Http::STATUS_OK, $response->getStatus()); $this->assertEquals($storageConfig, $response->getData()); }