tests/unit/Subjects/AbstractEavSubjectTest.php
/**
     * Test the getDefaultCallbackMappings() method when frontend input callback mappings have been merged.
     *
     * @return void
     */
Test the getDefaultCallbackMappings() method when frontend input callback mappings have been merged.
@return void
Test the getDefaultCallbackMappings () method when frontend input callback mappings have been merged . @return void
public function testGetCallbackMappingsWithMergeFrontendInputCallbackMappings()
    {
        $abstractEavSubject = $this->getSubjectInstance(array('getDefaultFrontendInputCallbackMappings'));
        $abstractEavSubject->expects($this->once())
                           ->method('getDefaultFrontendInputCallbackMappings')
                           ->willReturn(
                               array(
                                   FrontendInputTypes::SELECT => array('import_product.callback.select')
                               )
                           );
        $abstractEavSubject->expects($this->any())
            ->method('getEntityTypeCode')
            ->willReturn(EntityTypeCodes::CATALOG_PRODUCT);
        $callbackMappings = array(
            'custom_attribute'       => array('import_product.callback.select'),
            'attribute_code'         => array('import.test.callback-01.id'),
            'another_attribute_code' => array('import.test.callback-02.id')
        );
        $abstractEavSubject->setUp($this->serial = uniqid());
        $this->assertSame($callbackMappings, $abstractEavSubject->getCallbackMappings());
    }
public function testGetCallbackMappingsWithMergeFrontendInputCallbackMappings ( ) { $ abstractEavSubject = $ this -> getSubjectInstance ( array ( 'getDefaultFrontendInputCallbackMappings' ) ) ; $ abstractEavSubject -> expects ( $ this -> once ( ) ) -> method ( 'getDefaultFrontendInputCallbackMappings' ) -> willReturn ( array ( FrontendInputTypes :: SELECT => array ( 'import_product.callback.select' ) ) ) ; $ abstractEavSubject -> expects ( $ this -> any ( ) ) -> method ( 'getEntityTypeCode' ) -> willReturn ( EntityTypeCodes :: CATALOG_PRODUCT ) ; $ callbackMappings = array ( 'custom_attribute' => array ( 'import_product.callback.select' ) , 'attribute_code' => array ( 'import.test.callback-01.id' ) , 'another_attribute_code' => array ( 'import.test.callback-02.id' ) ) ; $ abstractEavSubject -> setUp ( $ this -> serial = uniqid ( ) ) ; $ this -> assertSame ( $ callbackMappings , $ abstractEavSubject -> getCallbackMappings ( ) ) ; }
Test the getDefaultCallbackMappings() method when frontend input callback mappings have been merged.
Test the getDefaultCallbackMappings () method when frontend input callback mappings have been merged .
// create the subject instance we want to test and invoke the setup method // mock the method to return the entity type code // initialize the callback mappings to compare // invoke the set-up method and qeuery whether or not the callback mappings are set