public function testHasNot()
 {
     $session = $this->getMock('PHPCR\\SessionInterface');
     $session->expects($this->never())->method('getNode');
     $session->expects($this->any())->method('getNamespacePrefixes')->will($this->returnValue(array('jcr', 'nt')));
     $objectManager = $this->getMockBuilder('Doctrine\\ODM\\PHPCR\\DocumentManager')->disableOriginalConstructor()->getMock();
     $objectManager->expects($this->any())->method('getPhpcrSession')->will($this->returnValue($session));
     $objectManager->expects($this->never())->method('find');
     $managerRegistry = $this->getMock('Doctrine\\Common\\Persistence\\ManagerRegistry');
     $managerRegistry->expects($this->any())->method('getManager')->will($this->returnValue($objectManager));
     $provider = new PhpcrMenuProvider($this->getMockBuilder('Knp\\Menu\\Loader\\NodeLoader')->disableOriginalConstructor()->getMock(), $managerRegistry, '/foo');
     $this->assertFalse($provider->has('notavalidnamespace:bar'));
     $this->assertFalse($provider->has('not:a:valid:name'));
 }
 /**
  *  @dataProvider getMenuTests
  */
 public function testHas($menuRoot, $name, $expectedPath)
 {
     $objectManager = $this->getDmMock($expectedPath);
     $objectManager->expects($this->once())->method('find')->with($this->equalTo(null), $this->equalTo($expectedPath))->will($this->returnValue($this->getMock('Knp\\Menu\\NodeInterface')));
     $managerRegistry = $this->getMock('Doctrine\\Common\\Persistence\\ManagerRegistry');
     $managerRegistry->expects($this->once())->method('getManager')->will($this->returnValue($objectManager));
     $provider = new PhpcrMenuProvider($this->getMock('Knp\\Menu\\FactoryInterface'), $managerRegistry, $menuRoot);
     $provider->has($name);
 }