Cviebrock\EloquentSluggable\Tests\BaseTests::testIssue5 PHP Method

testIssue5() public method

Test when reverting to a shorter version of a similar slug.
See also: https://github.com/cviebrock/eloquent-sluggable/issues/5
public testIssue5 ( )
    public function testIssue5()
    {
        $post = Post::create(['title' => 'My first post']);
        $this->assertEquals('my-first-post', $post->slug);
        $post->title = 'My first post rocks';
        $post->slug = null;
        $post->save();
        $this->assertEquals('my-first-post-rocks', $post->slug);
        $post->title = 'My first post';
        $post->slug = null;
        $post->save();
        $this->assertEquals('my-first-post', $post->slug);
    }