eZ\Publish\Core\Persistence\Legacy\Tests\Content\UrlAlias\SlugConverterTest::testConvertWithGivenTransformation PHP Method

testConvertWithGivenTransformation() public method

Test for the convert() method.
    public function testConvertWithGivenTransformation()
    {
        $slugConverter = $this->getSlugConverterMock(array('cleanupText'));
        $transformationProcessor = $this->getTransformationProcessorMock();
        $text = 'test text  č ';
        $transformedText = 'test text  c ';
        $slug = 'test_text_c';
        $transformationProcessor->expects($this->atLeastOnce())->method('transform')->with($text, array('test_command2'))->will($this->returnValue($transformedText));
        $slugConverter->expects($this->once())->method('cleanupText')->with($this->equalTo($transformedText), $this->equalTo('test_cleanup2'))->will($this->returnValue($slug));
        $this->assertEquals($slug, $slugConverter->convert($text, '_1', 'testTransformation2'));
    }