test/snac/server/validation/OperationValidatorTest.php
/**
     * Test delete constellation with insert name
     */
Test delete constellation with insert name
Test delete constellation with insert name
public function testValidateConstellationDeleteInsert() {
        $constellation = new \snac\data\Constellation();
        $constellation->setOperation(\snac\data\Constellation::$OPERATION_DELETE);
        $nameEntry = new \snac\data\NameEntry();
        $nameEntry->setOperation(\snac\data\NameEntry::$OPERATION_INSERT);
        $constellation->addNameEntry($nameEntry);
        try {
            $this->assertFalse($this->ve->validateConstellation($constellation),
                "Could validate delete constellation with insert nameEntry");
        } catch (\snac\exceptions\SNACValidationException $e) {
            $this->assertCount(1, $this->ve->getErrors(), "Did not get the right number of errors");
        }
    }
public function testValidateConstellationDeleteInsert ( ) { $ constellation = new \ snac \ data \ Constellation ( ) ; $ constellation -> setOperation ( \ snac \ data \ Constellation :: $ OPERATION_DELETE ) ; $ nameEntry = new \ snac \ data \ NameEntry ( ) ; $ nameEntry -> setOperation ( \ snac \ data \ NameEntry :: $ OPERATION_INSERT ) ; $ constellation -> addNameEntry ( $ nameEntry ) ; try { $ this -> assertFalse ( $ this -> ve -> validateConstellation ( $ constellation ) , " Could validate delete constellation with insert nameEntry " ) ; } catch ( \ snac \ exceptions \ SNACValidationException $ e ) { $ this -> assertCount ( 1 , $ this -> ve -> getErrors ( ) , " Did not get the right number of errors " ) ; } }
Test delete constellation with insert name
Test delete constellation with insert name
// We should get here!  Expecting an exception