test/snac/util/EACCPFParserTest.php
/**
     * Test that the parser correctly parses a given sample file and that munging the test Constellation
     * by toArray and fromArray still produces the same as the parser.
     */
Test that the parser correctly parses a given sample file and that munging the test Constellation
by toArray and fromArray still produces the same as the parser.
Test that the parser correctly parses a given sample file and that munging the test Constellation by toArray and fromArray still produces the same as the parser .
public function testParserConstellationEquality() {
        $parser = new \snac\util\EACCPFParser();
        $parser->setConstellationOperation(\snac\data\AbstractData::$OPERATION_INSERT);
        try {
            $identity = $parser->parseFile("test/snac/server/database/test_record.xml");
            $identity2 = new \snac\data\Constellation($identity->toArray());
            $this->assertTrue($identity->equals($identity2), "The copy is not equal to the original");
            $this->assertTrue($identity2->equals($identity), "The original is not equal to the copy");
        } catch (\snac\exceptions\SNACParserException $e) {
            $this->fail("Hit exception: " . $e->getMessage());
        }
    }
public function testParserConstellationEquality ( ) { $ parser = new \ snac \ util \ EACCPFParser ( ) ; $ parser -> setConstellationOperation ( \ snac \ data \ AbstractData :: $ OPERATION_INSERT ) ; try { $ identity = $ parser -> parseFile ( " test/snac/server/database/test_record.xml " ) ; $ identity2 = new \ snac \ data \ Constellation ( $ identity -> toArray ( ) ) ; $ this -> assertTrue ( $ identity -> equals ( $ identity2 ) , " The copy is not equal to the original " ) ; $ this -> assertTrue ( $ identity2 -> equals ( $ identity ) , " The original is not equal to the copy " ) ; } catch ( \ snac \ exceptions \ SNACParserException $ e ) { $ this -> fail ( " Hit exception:  " . $ e -> getMessage ( ) ) ; } }
Test that the parser correctly parses a given sample file and that munging the test Constellation
 by toArray and fromArray still produces the same as the parser.
Test that the parser correctly parses a given sample file and that munging the test Constellation by toArray and fromArray still produces the same as the parser .
// $parser->setVocabulary(new TestVocabulary()); // Parse the file into an identity