Changeset 56 for php/trunk/unittest/rdftestcases
- Timestamp:
- Jul 17, 2011, 7:54:35 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
php/trunk/unittest/rdftestcases/unittest.php
r27 r56 42 42 // -------------------------------------------------------- 43 43 44 private function _writeErrorData( $testcase, 45 $source, $sourceuri, 46 $result, $resulturi) { 47 if (!is_dir( $testcase)) 48 mkdir( $testcase, NULL, true); 49 50 $orgsource = file_get_contents( $sourceuri); 51 file_put_contents ( "$testcase/org_source.txt" , $orgsource); 52 53 $orgresult = file_get_contents( $resulturi); 54 file_put_contents ( "$testcase/org_result.txt" , $orgresult); 55 56 file_put_contents ( "$testcase/parsed_source.txt" , $source); 57 file_put_contents ( "$testcase/parsed_result.txt" , $result); 58 } 59 60 // -------------------------------------------------------- 61 44 62 private function _getSerializedData( $uri) { 45 63 … … 60 78 61 79 // read source data 62 $source = $this->_getSerializedData( self::BASEURI."/$testcase.rdf"); 80 $sourceuri = self::BASEURI."/$testcase.rdf"; 81 $source = $this->_getSerializedData( $sourceuri); 63 82 $this->assertEquals( ($source !== false), true); 64 83 65 84 // read target data 66 $result = $this->_getSerializedData( self::BASEURI."/$testcase.nt"); 85 $resulturi = self::BASEURI."/$testcase.nt"; 86 $result = $this->_getSerializedData( $resulturi); 67 87 $this->assertEquals( ($result !== false), true); 68 88 89 // check if results are equal 90 $success = ($source == $result); 91 92 // in case of error, write serialized data to subdirectory 93 if (!$success) 94 $this->_writeErrorData( $testcase, 95 $source, $sourceuri, 96 $result, $resulturi); 97 69 98 // compare source and target data 70 $this->assertEquals( ($source == $result), true);99 $this->assertEquals( $success, true); 71 100 72 101
Note:
See TracChangeset
for help on using the changeset viewer.