This commit is contained in:
Xes
2025-08-14 22:41:49 +02:00
parent 2de81ccc46
commit 8ce45119b6
39774 changed files with 4309466 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
<?php
/**
* This file is part of cocur/slugify.
*
* (c) Florian Eckerstorfer <florian@eckerstorfer.co>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Cocur\Slugify\Tests\Bridge\Plum;
use Cocur\Slugify\Bridge\Plum\SlugifyConverter;
use Mockery;
use PHPUnit_Framework_TestCase;
/**
* SlugifyConverterTest
*
* @package Cocur\Slugify\Bridge\Plum
* @author Florian Eckerstorfer <florian@eckerstorfer.co>
* @copyright 2012-2015 Florian Eckerstorfer
* @group unit
*/
class SlugifyConverterTest extends PHPUnit_Framework_TestCase
{
/**
* @test
* @covers Cocur\Slugify\Bridge\Plum\SlugifyConverter::__construct()
* @covers Cocur\Slugify\Bridge\Plum\SlugifyConverter::convert()
*/
public function convertSlugifiesString()
{
$slugify = Mockery::mock('Cocur\Slugify\SlugifyInterface');
$slugify->shouldReceive('slugify')->with('Hello World')->once()->andReturn('hello_world');
$converter = new SlugifyConverter($slugify);
$this->assertSame('hello_world', $converter->convert('Hello World'));
}
/**
* @test
* @covers Cocur\Slugify\Bridge\Plum\SlugifyConverter::__construct()
* @covers Cocur\Slugify\Bridge\Plum\SlugifyConverter::convert()
*/
public function constructorCreatesSlugifyIfNoneIsProvided()
{
$converter = new SlugifyConverter();
$this->assertSame('hello-world', $converter->convert('Hello World'));
}
}