public function testSuccessfulAssignment() {
        $this->simulateLogin('*****@*****.**');

        $builders = $this->buildPosts();

        $post_dao = DAOFactory::getDAO('PostDAO');
        $post = $post_dao->getPost(1, 'twitter');
        $this->assertEqual($post->in_reply_to_post_id, 0);

        $_GET["t"] = 'post.index.tpl';
        $_GET["ck"] = 'cachekey';
        $_GET["pid"] = 11;
        $_GET["oid"] = array(1);
        $_GET['n'] = 'twitter';

        $controller = new MarkParentController(true);
        $results = $controller->go();
        $this->assertPattern('/Assignment successful./', $results);

        $post = $post_dao->getPost(1, 'twitter');
        $this->assertEqual($post->in_reply_to_post_id, 11);

        // On second try, nothing changes
        $results = $controller->go();
        $this->assertPattern('/No data was changed./', $results);
    }
Example #2
0
<?php

chdir("..");
require_once 'init.php';
$controller = new MarkParentController();
echo $controller->go();