From 160b803a9e6556bb8a652aa329823da68ba5d9c3 Mon Sep 17 00:00:00 2001 From: Neil Blakey-Milner Date: Mon, 15 May 2006 11:31:29 +0000 Subject: [PATCH] Include file for all tests - turns KT into test mode (changes database, for example) on include. --- tests/test.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+), 0 deletions(-) create mode 100644 tests/test.php diff --git a/tests/test.php b/tests/test.php new file mode 100644 index 0000000..f9138d7 --- /dev/null +++ b/tests/test.php @@ -0,0 +1,34 @@ +pass('Expected results received'); + return; + } + + $iLen = count($aExpected); + for ($c = 0; $c < $iLen; $c++) { + if ($aReceived[$c] != $aExpected[$c]) { + $this->fail(sprintf("Failure. Expected %s, but got %s\n", $aExpected[$c], $aReceived[$c])); + } + } + } + + function assertEntity($oEntity, $sClass) { + if (is_a($oEntity, $sClass)) { + return $this->pass(sprintf('Object is a %s', $sClass)); + } + return $this->fail(sprintf('Object is not a %s', $sClass)); + } + + function assertGroup($oGroup) { + return $this->assertEntity($oGroup, 'Group'); + } +} -- libgit2 0.21.4