tests/unit/Subjects/AbstractEavSubjectTest.php
/**
     * Test the getAttributes() method with invalid entity type.
     *
     * @return void
     */
Test the getAttributes() method with invalid entity type.
@return void
Test the getAttributes () method with invalid entity type . @return void
public function testGetAttributesWithInvalidEntityTypeCode()
    {
        $this->expectException(\Exception::class);
        $this->expectExceptionMessage('Found invalid entity type code "unknown_entity_type"');
        $this->abstractEavSubject->expects($this->any())->method('getEntityTypeCode')->willReturn('unknown_entity_type');
        $this->abstractEavSubject->getAttributes();
    }
public function testGetAttributesWithInvalidEntityTypeCode ( ) { $ this -> expectException ( \ Exception :: class ) ; $ this -> expectExceptionMessage ( 'Found invalid entity type code "unknown_entity_type"' ) ; $ this -> abstractEavSubject -> expects ( $ this -> any ( ) ) -> method ( 'getEntityTypeCode' ) -> willReturn ( 'unknown_entity_type' ) ; $ this -> abstractEavSubject -> getAttributes ( ) ; }
Test the getAttributes() method with invalid entity type.
Test the getAttributes () method with invalid entity type .
// mock the method to return the entity type code // try to load the attributes for an invalid entity type code