tests/unit/Subjects/AbstractEavSubjectTest.php
/**
     * Test the getEavUserDefinedAttributes() method.
     *
     * @return void
     */
Test the getEavUserDefinedAttributes() method.
@return void
Test the getEavUserDefinedAttributes () method . @return void
public function testGetEavUserDefinedAttributes()
    {
        $this->abstractEavSubject->expects($this->any())
            ->method('getEntityTypeCode')
            ->willReturn(EntityTypeCodes::CATALOG_PRODUCT);
        $userDefinedAttributes = array(
            array(
                MemberNames::ATTRIBUTE_ID => 2,
                MemberNames::ENTITY_TYPE_ID => 4,
                MemberNames::ATTRIBUTE_CODE => 'custom_attribute',
                MemberNames::FRONTEND_INPUT => FrontendInputTypes::SELECT
            )
        );
        $this->assertSame($userDefinedAttributes, $this->abstractEavSubject->getEavUserDefinedAttributes());
    }
public function testGetEavUserDefinedAttributes ( ) { $ this -> abstractEavSubject -> expects ( $ this -> any ( ) ) -> method ( 'getEntityTypeCode' ) -> willReturn ( EntityTypeCodes :: CATALOG_PRODUCT ) ; $ userDefinedAttributes = array ( array ( MemberNames :: ATTRIBUTE_ID => 2 , MemberNames :: ENTITY_TYPE_ID => 4 , MemberNames :: ATTRIBUTE_CODE => 'custom_attribute' , MemberNames :: FRONTEND_INPUT => FrontendInputTypes :: SELECT ) ) ; $ this -> assertSame ( $ userDefinedAttributes , $ this -> abstractEavSubject -> getEavUserDefinedAttributes ( ) ) ; }
Test the getEavUserDefinedAttributes() method.
Test the getEavUserDefinedAttributes () method .
// mock the method to return the entity type code // initialize the array with the expected EAV user defined attributes // query that the EAV user defined attributes are returned