|
@@ 102-116 (lines=15) @@
|
| 99 |
|
* @expectedException \AppBundle\Exception\LocalStorageException |
| 100 |
|
* @expectedExceptionCode \AppBundle\Exception\LocalStorageException::OPERATION_FAIL |
| 101 |
|
*/ |
| 102 |
|
public function testFailedPutPermissions() |
| 103 |
|
{ |
| 104 |
|
$source = 'root/source/ADUU/stream/ADUU00313.mov'; |
| 105 |
|
$dest = 'root/dest/ADUU/stream/BCUU00113.mov'; |
| 106 |
|
|
| 107 |
|
/** |
| 108 |
|
* @var \org\bovigo\vfs\vfsStreamFile $vfsLockFile |
| 109 |
|
*/ |
| 110 |
|
$vfsLockFile = $this->root->getChild($source); |
| 111 |
|
$vfsLockFile->chmod(0400) |
| 112 |
|
->chown(1); |
| 113 |
|
|
| 114 |
|
$storage = new Local(); |
| 115 |
|
$storage->put(vfsStream::url($source), vfsStream::url($dest)); |
| 116 |
|
} |
| 117 |
|
|
| 118 |
|
public function testDelete() |
| 119 |
|
{ |
|
@@ 143-156 (lines=14) @@
|
| 140 |
|
* @expectedException \AppBundle\Exception\LocalStorageException |
| 141 |
|
* @expectedExceptionCode \AppBundle\Exception\LocalStorageException::OPERATION_FAIL |
| 142 |
|
*/ |
| 143 |
|
public function testFailedDeletePermissions() |
| 144 |
|
{ |
| 145 |
|
$storage = new Local(); |
| 146 |
|
|
| 147 |
|
$dest = 'root/dest/ADUU/stream/ADUU00313.mov'; |
| 148 |
|
/** |
| 149 |
|
* @var \org\bovigo\vfs\vfsStreamFile $vfsDestDir |
| 150 |
|
*/ |
| 151 |
|
$vfsDestDir = $this->root->getChild(dirname($dest)); |
| 152 |
|
$vfsDestDir->chmod(0400) |
| 153 |
|
->chown(1); |
| 154 |
|
|
| 155 |
|
$storage->delete(vfsStream::url($dest)); |
| 156 |
|
} |
| 157 |
|
|
| 158 |
|
public function testList() |
| 159 |
|
{ |
|
@@ 191-205 (lines=15) @@
|
| 188 |
|
* @expectedException \AppBundle\Exception\LocalStorageException |
| 189 |
|
* @expectedExceptionCode \AppBundle\Exception\LocalStorageException::OPERATION_FAIL |
| 190 |
|
*/ |
| 191 |
|
public function testDirectoryFailed() |
| 192 |
|
{ |
| 193 |
|
$source = 'root/source/ADUU/stream/ADUU00313.mov'; |
| 194 |
|
$dest = 'root/dest/XXXX/stream/ADUU00313.mov'; |
| 195 |
|
|
| 196 |
|
/** |
| 197 |
|
* @var \org\bovigo\vfs\vfsStreamFile $vfsDestDir |
| 198 |
|
*/ |
| 199 |
|
$vfsDestDir = $this->root->getChild('root/dest'); |
| 200 |
|
$vfsDestDir->chmod(0400) |
| 201 |
|
->chown(1); |
| 202 |
|
|
| 203 |
|
$storage = new Local(); |
| 204 |
|
$storage->put(vfsStream::url($source), vfsStream::url($dest)); |
| 205 |
|
} |
| 206 |
|
} |
| 207 |
|
|