tests/unit/Utils/UrlKeyUtilTest.php
/**
     * Test if makeUnique() method returns a different key if we pass the same one but with different entities.
     *
     * @return void
     */
Test if makeUnique() method returns a different key if we pass the same one but with different entities.
@return void
Test if makeUnique () method returns a different key if we pass the same one but with different entities . @return void
public function testMakeUniqueWithMultipleInvocationsSameKeyButDifferentCategoryEntities() : void
    {
        $urlKeyUtil = $this->getMockUrlKeyUtil(UrlRewriteEntityType::CATEGORY);
        $mockSubject = $this->getMockSubject(8765);
        $entity = array(MemberNames::ENTITY_ID => 8765);
        $this->assertSame(
            'testcategory',
            $urlKeyUtil->makeUnique($mockSubject, $entity, 'testcategory', array())
        );
        $mockSubject = $this->getMockSubject(8766);
        $entity = array(MemberNames::ENTITY_ID => 8766);
        $this->assertSame(
            'testcategory',
            $urlKeyUtil->makeUnique($mockSubject, $entity, 'testcategory', array('testcategory'))
        );
    }
public function testMakeUniqueWithMultipleInvocationsSameKeyButDifferentCategoryEntities ( ) : void { $ urlKeyUtil = $ this -> getMockUrlKeyUtil ( UrlRewriteEntityType :: CATEGORY ) ; $ mockSubject = $ this -> getMockSubject ( 8765 ) ; $ entity = array ( MemberNames :: ENTITY_ID => 8765 ) ; $ this -> assertSame ( 'testcategory' , $ urlKeyUtil -> makeUnique ( $ mockSubject , $ entity , 'testcategory' , array ( ) ) ) ; $ mockSubject = $ this -> getMockSubject ( 8766 ) ; $ entity = array ( MemberNames :: ENTITY_ID => 8766 ) ; $ this -> assertSame ( 'testcategory' , $ urlKeyUtil -> makeUnique ( $ mockSubject , $ entity , 'testcategory' , array ( 'testcategory' ) ) ) ; }
Test if makeUnique() method returns a different key if we pass the same one but with different entities.
Test if makeUnique () method returns a different key if we pass the same one but with different entities .
// load the URL key utility we want to test // load the mock subject instance // initialize the entity // assert the unique URL key // load the mock subject instance // initialize the entity // assert the unique URL key