Skip to content

Instantly share code, notes, and snippets.

@kroatoanweb
Last active August 1, 2016 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kroatoanweb/34796c2c553be731b6084a02ce194028 to your computer and use it in GitHub Desktop.
Save kroatoanweb/34796c2c553be731b6084a02ce194028 to your computer and use it in GitHub Desktop.
<?php
namespace Tests\AppBundle\Manager;
use AppBundle\Manager\DocumentManager;
use AppBundle\Document\Post;
class DocumentManagerTest extends \PHPUnit_Framework_TestCase
{
public function testAddDocument()
{
$admin = new DocumentManager();
$document = $this->getMock(Post::class);
$document->expects($this->once())
->method('getSlug')
->will($this->returnValue('post-slug'));
$this->assertTrue($admin->addDocument($document), 'El documento no se ha podido agregar');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment