summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorbitweaver.org <bitweaver@users.sourceforge.net>2005-06-30 01:10:46 +0000
committerbitweaver.org <bitweaver@users.sourceforge.net>2005-06-30 01:10:46 +0000
commit75f897b0257d44dc1cb37f09844ebc1824c37752 (patch)
tree1b8398e36508b75a438b5b357fe23d95fb261964 /test
downloadarticles-75f897b0257d44dc1cb37f09844ebc1824c37752.tar.gz
articles-75f897b0257d44dc1cb37f09844ebc1824c37752.tar.bz2
articles-75f897b0257d44dc1cb37f09844ebc1824c37752.zip
IMPORT TikiPro CLYDE FINAL
Diffstat (limited to 'test')
-rw-r--r--test/TestTikiArticle.php86
-rw-r--r--test/index.php6
2 files changed, 92 insertions, 0 deletions
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 @@
+<?php
+require_once('../../bit_setup_inc.php');
+require_once(ARTICLES_PKG_PATH.'BitArticle.php');
+
+class TestBitArticle extends Test {
+
+ var $test;
+ var $id;
+ var $count;
+
+ function TestBitArticle()
+ {
+ $this->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 @@
+<?php
+
+require_once( '../../bit_setup_inc.php' );
+require_once( KERNEL_PKG_PATH.'test/index.php' );
+
+?>