SlugifyHelperTest.php 970 B

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