Author: Florian Eckerstorfer (florian@eckerstorfer.co)
Inheritance: extends Twig_Extension
Exemple #1
0
 /**
  * Constructor.
  *
  * @param string $destPath
  */
 public function __construct($destPath)
 {
     $this->destPath = $destPath;
     parent::__construct(Slugify::create(['regexp' => Page::SLUGIFY_PATTERN]));
 }
 /**
  * @test
  * @covers Cocur\Slugify\Bridge\Twig\SlugifyExtension::slugifyFilter()
  */
 public function slugifyFilter()
 {
     $this->slugify->shouldReceive('slugify')->with('hällo wörld', '_')->once()->andReturn('haello_woerld');
     $this->assertEquals('haello_woerld', $this->extension->slugifyFilter('hällo wörld', '_'));
 }