test/snac/server/database/DBUtilTest.php
/**
     * Test delete by changing status
     *
     * Change constellation status to deleted in order to delete the whole constellation.
     */
Test delete by changing status
Change constellation status to deleted in order to delete the whole constellation.
Test delete by changing status Change constellation status to deleted in order to delete the whole constellation .
public function testDeleteViaWriteConstellationStatus()
    {
        $this->logger->addDebug("Starting: " . __METHOD__);
        $eParser = new \snac\util\EACCPFParser();
        $eParser->setConstellationOperation(\snac\data\AbstractData::$OPERATION_INSERT);
        $cObj = $eParser->parseFile("test/snac/server/database/test_record.xml");
        $cObj->getPlaces()[1]->setConfirmed(true);
        $firstJSON = $cObj->toJSON();
        $startingARK = $cObj->getArk();
        $startingEntity = $cObj->getEntityType()->getTerm();
        $retObj = $this->dbu->writeConstellation($this->user,
                                                 $cObj,
                                                 'ingest in order to delete via status',
                                                 'ingest cpf');
        $delVersion = $this->dbu->writeConstellationStatus($this->user, $retObj->getID(), 'deleted');
        global $log;
        if (! $this->logger)
        {
            $this->logger = new \Monolog\Logger('DBUtil');
            $this->logger->pushHandler($log);
        }
        $this->logger->addDebug(sprintf("delete via status version: %s ic_id: %s", $delVersion, $retObj->getID()));
        $this->assertNotFalse($delVersion);
        $this->logger->addDebug("Ending: " . __METHOD__);
    }
public function testDeleteViaWriteConstellationStatus ( ) { $ this -> logger -> addDebug ( " Starting:  " . __METHOD__ ) ; $ eParser = new \ snac \ util \ EACCPFParser ( ) ; $ eParser -> setConstellationOperation ( \ snac \ data \ AbstractData :: $ OPERATION_INSERT ) ; $ cObj = $ eParser -> parseFile ( " test/snac/server/database/test_record.xml " ) ; $ cObj -> getPlaces ( ) [ 1 ] -> setConfirmed ( true ) ; $ firstJSON = $ cObj -> toJSON ( ) ; $ startingARK = $ cObj -> getArk ( ) ; $ startingEntity = $ cObj -> getEntityType ( ) -> getTerm ( ) ; $ retObj = $ this -> dbu -> writeConstellation ( $ this -> user , $ cObj , 'ingest in order to delete via status' , 'ingest cpf' ) ; $ delVersion = $ this -> dbu -> writeConstellationStatus ( $ this -> user , $ retObj -> getID ( ) , 'deleted' ) ; global $ log ; if ( ! $ this -> logger ) { $ this -> logger = new \ Monolog \ Logger ( 'DBUtil' ) ; $ this -> logger -> pushHandler ( $ log ) ; } $ this -> logger -> addDebug ( sprintf ( " delete via status version: %s ic_id: %s " , $ delVersion , $ retObj -> getID ( ) ) ) ; $ this -> assertNotFalse ( $ delVersion ) ; $ this -> logger -> addDebug ( " Ending:  " . __METHOD__ ) ; }
Test delete by changing status
 Change constellation status to deleted in order to delete the whole constellation.
Test delete by changing status Change constellation status to deleted in order to delete the whole constellation .
// create a log channel