/**
  * @param AbstractEntity $entity
  *
  * @return Seo
  */
 public function findOrCreateFor(AbstractEntity $entity)
 {
     $seo = $this->findFor($entity);
     if (is_null($seo)) {
         $seo = new Seo();
         $seo->setRef($entity);
     }
     return $seo;
 }
 /**
  * @param string $title
  */
 protected function seoFoundWithTitle($title)
 {
     $this->ensureSeoRepoMock();
     $seoMock = new Seo();
     $seoMock->setRef($this->entityMock);
     $seoMock->setMetaTitle($title);
     $this->seoRepoMock->expects($this->once())->method('findFor')->will($this->returnValue($seoMock));
     $this->wireUpSeoRepo();
 }
Example #3
0
 /**
  * @covers Kunstmaan\SeoBundle\Entity\Seo::getDefaultAdminType
  */
 public function testGetDefaultAdminType()
 {
     $this->assertInstanceOf('Kunstmaan\\SeoBundle\\Form\\SeoType', $this->object->getDefaultAdminType());
 }