Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SeoBundle] Fixed issue that OG image can not be deleted #452

Merged
merged 1 commit into from May 28, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Kunstmaan/SeoBundle/Entity/Seo.php
Expand Up @@ -350,7 +350,7 @@ public function getOgDescription()
*
* @return Seo
*/
public function setOgImage(Media $ogImage)
public function setOgImage(Media $ogImage = null)
{
$this->ogImage = $ogImage;

Expand Down
17 changes: 14 additions & 3 deletions src/Kunstmaan/SeoBundle/Tests/Entity/SeoTest.php
Expand Up @@ -105,10 +105,21 @@ public function testGetSetOgDescription()
* @covers Kunstmaan\SeoBundle\Entity\Seo::setOgImage
* @covers Kunstmaan\SeoBundle\Entity\Seo::getOgImage
*/
public function testGetSetOgImage()
public function testGetSetOgImageWithImage()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete('This test has not been implemented yet.');
$media = $this->getMock('Kunstmaan\MediaBundle\Entity\Media');
$this->object->setOgImage($media);
$this->assertEquals($media, $this->object->getOgImage());
}

/**
* @covers Kunstmaan\SeoBundle\Entity\Seo::setOgImage
* @covers Kunstmaan\SeoBundle\Entity\Seo::getOgImage
*/
public function testGetSetOgImageWithNullValue()
{
$this->object->setOgImage(null);
$this->assertEquals(null, $this->object->getOgImage());
}

/**
Expand Down