Skip to content

Instantly share code, notes, and snippets.

@kroatoanweb
Created August 1, 2016 19:47
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/2a4eb54ca6c1f0d82c51cf1283db32ad to your computer and use it in GitHub Desktop.
Save kroatoanweb/2a4eb54ca6c1f0d82c51cf1283db32ad to your computer and use it in GitHub Desktop.
<?php
namespace Tests\AppBundle\Manager;
use AppBundle\Manager\DocumentManager;
class DocumentManagerTest extends \PHPUnit_Framework_TestCase
{
public function testAddDocument()
{
$admin = new DocumentManager();
$document = $this->getMockBuilder("Post")
->setMethods(array('getSlug'))
->getMock();
$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