SlugifyHelperTest.php 941 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Cocur\Slugify\Tests\Bridge\Latte;
  3. use Cocur\Slugify\Bridge\Latte\SlugifyHelper;
  4. use Mockery as m;
  5. /**
  6. * SlugifyHelperTest
  7. *
  8. * @category test
  9. * @package cocur/slugify
  10. * @subpackage bridge
  11. * @author Lukáš Unger <looky.msc@gmail.com>
  12. * @license http://www.opensource.org/licenses/MIT The MIT License
  13. * @group unit
  14. */
  15. class SlugifyHelperTest extends \PHPUnit_Framework_TestCase
  16. {
  17. protected function setUp()
  18. {
  19. $this->slugify = m::mock('Cocur\Slugify\SlugifyInterface');
  20. $this->helper = new SlugifyHelper($this->slugify);
  21. }
  22. /**
  23. * @test
  24. * @covers Cocur\Slugify\Bridge\Latte\SlugifyHelper::slugify()
  25. */
  26. public function slugify()
  27. {
  28. $this->slugify->shouldReceive('slugify')->with('hällo wörld', '_')->once()->andReturn('haello_woerld');
  29. $this->assertEquals('haello_woerld', $this->helper->slugify('hällo wörld', '_'));
  30. }
  31. }