/**
  * Create the guesser for this test.
  *
  * @return GuesserInterface
  */
 protected function createGuesser()
 {
     $this->registry = $this->getMockBuilder('\\Doctrine\\Bundle\\PHPCRBundle\\ManagerRegistry')->disableOriginalConstructor()->getMock();
     $this->manager = $this->getMockBuilder('\\Doctrine\\ODM\\PHPCR\\DocumentManager')->disableOriginalConstructor()->getMock();
     $this->metadata = $this->getMockBuilder('\\Doctrine\\ODM\\PHPCR\\Mapping\\ClassMetadata')->disableOriginalConstructor()->getMock();
     $this->registry->expects($this->any())->method('getManagerForClass')->with($this->equalTo('Symfony\\Cmf\\Bundle\\SeoBundle\\Tests\\Unit\\Sitemap\\LastModifiedGuesserTest'))->will($this->returnValue($this->manager));
     $this->manager->expects($this->any())->method('getClassMetadata')->with($this->equalTo('Symfony\\Cmf\\Bundle\\SeoBundle\\Tests\\Unit\\Sitemap\\LastModifiedGuesserTest'))->will($this->returnValue($this->metadata));
     $this->metadata->expects($this->any())->method('getMixins')->will($this->returnValue(array('mix:lastModified')));
     $this->metadata->expects($this->any())->method('getFieldNames')->will($this->returnValue(array('lastModified')));
     $this->metadata->expects($this->any())->method('getFieldMapping')->with($this->equalTo('lastModified'))->will($this->returnValue(array('property' => 'jcr:lastModified')));
     $this->metadata->expects($this->any())->method('getFieldValue')->with($this->equalTo($this), $this->equalTo('lastModified'))->will($this->returnValue(new \DateTime('2016-07-06', new \DateTimeZone('Europe/Berlin'))));
     return new LastModifiedGuesser($this->registry);
 }
 /**
  * @dataProvider provideExpandClassName
  */
 public function testExpandClassName($className, $fqClassName, $isAlias)
 {
     if ($isAlias) {
         $this->dm->expects($this->once())->method('getClassMetadata')->with($className)->will($this->returnValue($this->metadata));
         $this->metadata->expects($this->once())->method('getName')->will($this->returnValue($fqClassName));
     }
     $refl = new \ReflectionClass($this->mapper);
     $method = $refl->getMethod('expandClassName');
     $method->setAccessible(true);
     $res = $method->invoke($this->mapper, $this->dm, $className);
     $this->assertEquals($fqClassName, $res);
 }