File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,22 @@ public function testExport($testcase)
6565 $ testcase_result = ob_get_contents ();
6666 ob_end_clean ();
6767
68- $ this ->assertEquals (md5 ($ testcase_result ), md5 ($ testcase_expect ))
68+ $ expected_result = __DIR__ . '/ ' . $ testcase_id . '.testcase.expect ' ;
69+ $ acctural_result = __DIR__ . '/ ' . $ testcase_id . '.testcase.result ' ;
70+
71+ $ msg = <<<EOF
72+ Test case ' $ testcase' has failed.
73+ Expected result has been dumped to ' $ expected_result'
74+ Acctural result has been dumped to ' $ acctural_result'
75+ EOF ;
76+
77+ try {
78+ $ this ->assertEquals (md5 ($ testcase_expect ), md5 ($ testcase_result ), $ msg );
79+ } catch (PHPUnit_Framework_ExpectationFailedException $ e ) {
80+ file_put_contents ($ expected_result , $ testcase_expect );
81+ file_put_contents ($ acctural_result , $ testcase_result );
82+ throw $ e ;
83+ }
6984 }
7085
7186}
You can’t perform that action at this time.
0 commit comments