示例#1
0
    function testUpdateThreadInfo()
    {
        // Create thread start.
    	$message = new Phorum_message();
    	$message->create(1, 'delete me');
    	$messageId = $message->getMessageId();

    	// add message to the thread.
    	$message2 = new Phorum_message();
    	$message2->create(1, "delete me", "wow", $messageId, $messageId);

    	$message->fetch();
    	$threadCount = $message->getNumMessagesInThread();

    	$message2->delete();

    	$message->fetch();
    	$threadCount2 = $message->getNumMessagesInThread();

    	if ($threadCount != ($threadCount2 + 1)) {
    		$this->fail("Thread stats not updated correctly.");
    	}
    }