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 testMakeUniqueWithMultipleInvocationsSameKeyButDifferentEntity() : void
    {
        $urlKeyUtil = $this->getMockUrlKeyUtil();
        $mockSubject = $this->getMockSubject(8765);
        $entity = array(MemberNames::ENTITY_ID => 8765);
        $this->assertSame(
            'testproduct',
            $urlKeyUtil->makeUnique($mockSubject, $entity, 'testproduct', array())
        );
        $mockSubject = $this->getMockSubject(8764);
        $entity = array(MemberNames::ENTITY_ID => 8764);
        $this->assertSame(
            'testproduct-1',
            $urlKeyUtil->makeUnique($mockSubject, $entity, 'testproduct', array())
        );
    }
public function testMakeUniqueWithMultipleInvocationsSameKeyButDifferentEntity ( ) : void { $ urlKeyUtil = $ this -> getMockUrlKeyUtil ( ) ; $ mockSubject = $ this -> getMockSubject ( 8765 ) ; $ entity = array ( MemberNames :: ENTITY_ID => 8765 ) ; $ this -> assertSame ( 'testproduct' , $ urlKeyUtil -> makeUnique ( $ mockSubject , $ entity , 'testproduct' , array ( ) ) ) ; $ mockSubject = $ this -> getMockSubject ( 8764 ) ; $ entity = array ( MemberNames :: ENTITY_ID => 8764 ) ; $ this -> assertSame ( 'testproduct-1' , $ urlKeyUtil -> makeUnique ( $ mockSubject , $ entity , 'testproduct' , array ( ) ) ) ; }
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