public function testNodeExistsNotExists() { $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)); $root->expects($this->once())->method('get')->with('/bar/foo/asd')->will($this->throwException(new NotFoundException())); $node = new \OC\Files\Node\Folder($root, $view, '/bar/foo'); $this->assertFalse($node->nodeExists('asd')); }