test/snac/server/validation/ResourceValidatorTest.php
/**
     * Test validating a constellation with null resource
     */
Test validating a constellation with null resource
Test validating a constellation with null resource
public function testValidateConstellationNullResource() {
        $constellation = new \snac\data\Constellation();
        $resource = null;
        $resourceRelation = new \snac\data\ResourceRelation();
        $constellation->addResourceRelation($resourceRelation);
        try {
            $this->assertFalse($this->ve->validateConstellation($constellation),
            "Constellation with null resource validated when it shouldn't have");
        } catch (\Exception $e) {
            $this->assertNotEmpty($this->ve->getErrors());
        }
    }
public function testValidateConstellationNullResource ( ) { $ constellation = new \ snac \ data \ Constellation ( ) ; $ resource = null ; $ resourceRelation = new \ snac \ data \ ResourceRelation ( ) ; $ constellation -> addResourceRelation ( $ resourceRelation ) ; try { $ this -> assertFalse ( $ this -> ve -> validateConstellation ( $ constellation ) , " Constellation with null resource validated when it shouldn't have " ) ; } catch ( \ Exception $ e ) { $ this -> assertNotEmpty ( $ this -> ve -> getErrors ( ) ) ; } }
Test validating a constellation with null resource
Test validating a constellation with null resource
// catching an exception is good