summaryrefslogtreecommitdiffstats
path: root/3rdparty/simpletest/test/recorder_test.php
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/simpletest/test/recorder_test.php')
-rwxr-xr-x3rdparty/simpletest/test/recorder_test.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/3rdparty/simpletest/test/recorder_test.php b/3rdparty/simpletest/test/recorder_test.php
new file mode 100755
index 00000000000..fdae4c1cccc
--- /dev/null
+++ b/3rdparty/simpletest/test/recorder_test.php
@@ -0,0 +1,23 @@
+<?php
+// $Id: test.php 1500 2007-04-29 14:33:31Z pp11 $
+require_once(dirname(__FILE__) . '/../autorun.php');
+require_once(dirname(__FILE__) . '/../recorder.php');
+
+class TestOfRecorder extends UnitTestCase {
+
+ function testContentOfRecorderWithOnePassAndOneFailure() {
+ $test = new TestSuite();
+ $test->addFile(dirname(__FILE__) . '/support/recorder_sample.php');
+ $recorder = new Recorder(new SimpleReporter());
+ $test->run($recorder);
+ $this->assertEqual(count($recorder->results), 2);
+ $this->assertIsA($recorder->results[0], 'SimpleResultOfPass');
+ $this->assertEqual('testTrueIsTrue', array_pop($recorder->results[0]->breadcrumb));
+ $this->assertPattern('/ at \[.*\Wrecorder_sample\.php line 7\]/', $recorder->results[0]->message);
+ $this->assertIsA($recorder->results[1], 'SimpleResultOfFail');
+ $this->assertEqual('testFalseIsTrue', array_pop($recorder->results[1]->breadcrumb));
+ $this->assertPattern("/Expected false, got \[Boolean: true\] at \[.*\Wrecorder_sample\.php line 11\]/",
+ $recorder->results[1]->message);
+ }
+}
+?> \ No newline at end of file