Пример #1
0
printf("STARTING ForumTopic UNIT TESTS\n");
printf("/////////////////////////////////\n");
//construct empty forum topic
$forumTopic = new ForumTopic();
//add topic
$forumTopic->createForum("kmassey", "Dummy Topic", "Dummy question");
//delete topic
$forumTopic->deleteForum();
//fetch existing forumTopic
$forumTopic2 = new ForumTopic(1895578464);
//fetch description of existing forum Topic
$topic_description = $forumTopic2->getTopicDescription();
printf("Fetched Topic description: %s\n", $topic_description);
//block forum topic
printf("Blocking topic %d\n", 1895578464);
$forumTopic2->block();
$isBlocked = $forumTopic2->isBlocked();
$bool_str = $isBlocked ? "true" : "false";
printf("Forum Topic %d is blocked:  %s\n", 1895578464, $bool_str);
//unblock forum topic
printf("Unblocking topic %d\n", 1895578464);
$forumTopic2->unblock();
$isBlocked = $forumTopic2->isBlocked();
$bool_str = $isBlocked ? "true" : "false";
printf("Forum Topic %d is blocked: %s\n", 1895578464, $bool_str);
////////////////////////////
//ForumPost UNIT TESTS
////////////////////////////
printf("/////////////////////////////////\n");
printf("STARTING ForumPost UNIT TESTS\n");
printf("/////////////////////////////////\n");