Example #1
0
 public function testWrapper()
 {
     $test = $this;
     $wrapper = function ($mountPoint, $storage) use(&$test) {
         $test->assertEquals('/foo/', $mountPoint);
         $test->assertInstanceOf('\\OC\\Files\\Storage\\Storage', $storage);
         return new Wrapper(array('storage' => $storage));
     };
     $loader = new Loader();
     $loader->addStorageWrapper('test_wrapper', $wrapper);
     $storage = $this->getMockBuilder('\\OC\\Files\\Storage\\Temporary')->disableOriginalConstructor()->getMock();
     $mount = new \OC\Files\Mount\Mount($storage, '/foo', array(), $loader);
     $this->assertInstanceOf('\\OC\\Files\\Storage\\Wrapper\\Wrapper', $mount->getStorage());
 }