tests/unit/Subjects/ExportableTraitTest.php
/**
     * Test the getArtefactsByTypeAndEntityId() method.
     *
     * @return void
     */
Test the getArtefactsByTypeAndEntityId() method.
@return void
Test the getArtefactsByTypeAndEntityId () method . @return void
public function testGetArtefactsByTypeAndEntityId()
    {
        $this->exportableTrait->setLastEntityId($lastEntityId = 1000);
        $type = 'product-variants';
        $artfacts = array(
            array(
                ColumnKeys::ATTRIBUTE_CODE => 'a_attribute_code',
                ColumnKeys::VALUE          => 1001
            )
        );
        $this->exportableTrait->addArtefacts($type, $artfacts);
        $this->assertCount(1, $this->exportableTrait->getArtefactsByTypeAndEntityId($type, $lastEntityId));
        $this->assertSame($artfacts, $this->exportableTrait->getArtefactsByTypeAndEntityId($type, $lastEntityId));
    }
public function testGetArtefactsByTypeAndEntityId ( ) { $ this -> exportableTrait -> setLastEntityId ( $ lastEntityId = 1000 ) ; $ type = 'product-variants' ; $ artfacts = array ( array ( ColumnKeys :: ATTRIBUTE_CODE => 'a_attribute_code' , ColumnKeys :: VALUE => 1001 ) ) ; $ this -> exportableTrait -> addArtefacts ( $ type , $ artfacts ) ; $ this -> assertCount ( 1 , $ this -> exportableTrait -> getArtefactsByTypeAndEntityId ( $ type , $ lastEntityId ) ) ; $ this -> assertSame ( $ artfacts , $ this -> exportableTrait -> getArtefactsByTypeAndEntityId ( $ type , $ lastEntityId ) ) ; }
Test the getArtefactsByTypeAndEntityId() method.
Test the getArtefactsByTypeAndEntityId () method .
// set serial, filename, linenumber and last entity ID // initialize the artefact type // initialize the artefacts to import // add the artefacts and compare the result