From 75f897b0257d44dc1cb37f09844ebc1824c37752 Mon Sep 17 00:00:00 2001 From: "bitweaver.org" Date: Thu, 30 Jun 2005 01:10:46 +0000 Subject: IMPORT TikiPro CLYDE FINAL --- test/TestTikiArticle.php | 86 ++++++++++++++++++++++++++++++++++++++++++++++++ test/index.php | 6 ++++ 2 files changed, 92 insertions(+) create mode 100644 test/TestTikiArticle.php create mode 100644 test/index.php (limited to 'test') diff --git a/test/TestTikiArticle.php b/test/TestTikiArticle.php new file mode 100644 index 0000000..4f1d2ff --- /dev/null +++ b/test/TestTikiArticle.php @@ -0,0 +1,86 @@ +test = new BitArticle(); + Assert::equalsTrue($this->test != NULL, 'Error during initialisation'); + } + + function testGetItems() + { + $filter = array(); + $list = $this->test->getList($filter); + $this->count = count($list); + Assert::equalsTrue(is_array($list)); + } + + function testStoreItem() + { + $newItemHash = array( + "title" => "Test Title", + "description" => "Test Description", + "data" => "Test Text", + "topic_id" => NULL, + "topic_name" => NULL, + "size" => NULL, + "use_image" => NULL, + "image_name" => NULL, + "image_type" => NULL, + "image_size" => NULL, + "image_x" => NULL, + "image_y" => NULL, + "image_data" => "", + "publish_date" => NULL, + "expire_date" => NULL, + "hash" => NULL, + "type" => NULL, + "isfloat" => NULL, + ); + Assert::equalsTrue($this->test->store($newItemHash)); + } + + function testIsValidItem() + { + Assert::equalsTrue($this->test->isValid()); + } + + function testNullItem() + { + $this->id = $this->test->mArticleId; + $this->test = NULL; + Assert::equals($this->test, NULL); + } + + function testLoadItem() + { + $this->test = new BitArticle($this->id); + Assert::equals($this->test->load(), 37); + } + + function testUrlItem() + { + Assert::equalsTrue($this->test->getDisplayUrl() != ""); + } + + function testExpungeItem() + { + Assert::equalsTrue($this->test->expunge()); + } + + function testCountItems() + { + $filter = array(); + $count = count($this->test->getList($filter)); + Assert::equals($this->count, $count); + } + +} +?> diff --git a/test/index.php b/test/index.php new file mode 100644 index 0000000..676c174 --- /dev/null +++ b/test/index.php @@ -0,0 +1,6 @@ + -- cgit v1.3