Example #1
0
 public function testGetEtag()
 {
     $manager = $this->getMock('\\OC\\Files\\Mount\\Manager');
     /**
      * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view
      */
     $view = $this->getMock('\\OC\\Files\\View');
     $root = $this->getMock('\\OC\\Files\\Node\\Root', array(), array($manager, $view, $this->user));
     $root->expects($this->any())->method('getUser')->will($this->returnValue($this->user));
     $stat = array('fileid' => 1, 'size' => 100, 'etag' => 'qwerty', 'mtime' => 50);
     $view->expects($this->once())->method('getFileInfo')->with('/bar/foo')->will($this->returnValue($stat));
     $node = new \OC\Files\Node\File($root, $view, '/bar/foo');
     $this->assertEquals('qwerty', $node->getEtag());
 }