Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 11c5630b2c8f00f64861e0dac51a202a > files > 257

php-gtk2-2.0.1-12mdv2010.0.i586.rpm

<?php
// Call GtkTreeModelFilterTest::main() if this source file is executed directly.
if (!defined("PHPUnit_MAIN_METHOD")) {
    define("PHPUnit_MAIN_METHOD", "GtkTreeModelFilterTest::main");
}

require_once "PHPUnit/Framework/TestCase.php";
require_once "PHPUnit/Framework/TestSuite.php";

// You may remove the following line when all tests have been implemented.
require_once "PHPUnit/Framework/IncompleteTestError.php";



/**
 * Test class for GtkTreeModelFilter.
 * Generated by PHPUnit_Util_Skeleton on 2006-03-07 at 13:26:41.
 */
class GtkTreeModelFilterTest extends PHPUnit_Framework_TestCase {
    /**
     * Runs the test methods of this class.
     *
     * @access public
     * @static
     */
    public static function main() {
        require_once "PHPUnit/TextUI/TestRunner.php";

        $suite  = new PHPUnit_Framework_TestSuite("GtkTreeModelFilterTest");
        $result = PHPUnit_TextUI_TestRunner::run($suite);
    }

    /**
     * Sets up the fixture, for example, open a network connection.
     * This method is called before a test is executed.
     *
     * @access protected
     */
    protected function setUp() {
        $this->mod = new GtkTreeStore(Gtk::TYPE_STRING);
        $this->a = $this->mod->append(null, array('a'));
            $this->aa = $this->mod->append($this->a, array('aa'));
            $this->ab = $this->mod->append($this->a, array('ab'));
            $this->ac = $this->mod->append($this->a, array('ac'));
            $this->ad = $this->mod->append($this->a, array('ad'));
        $this->b = $this->mod->append(null, array('b'));
        $this->c = $this->mod->append(null, array('c'));


        $path_a = $this->mod->get_path($this->a);
        $this->assertNotNull($path_a);
        $this->tmf = new GtkTreeModelFilter($this->mod, $path_a);

        $this->assertEquals(3, $this->mod->iter_n_children(null));
        $this->assertEquals(4, $this->mod->iter_n_children($this->a));

        $this->assertNotNull($this->tmf->get_property('child-model'));
        $this->assertEquals($this->mod, $this->tmf->get_property('child-model'));

        $this->assertNotNull($this->tmf->get_property('virtual-root'));
        $this->assertEquals(4, $this->tmf->iter_n_children(null));
    }

    /**
     * Tears down the fixture, for example, close a network connection.
     * This method is called after a test is executed.
     *
     * @access protected
     */
    protected function tearDown() {
    }

    /**
     * @todo Implement testClear_cache().
     */
    public function testClear_cache() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     *
     */
    public function testConvert_child_iter_to_iter() {
        $child_a = $this->mod->get_iter_first();
        $this->assertNotNull($child_a);
        $this->assertType('GtkTreeIter', $child_a);
        $this->assertEquals('a', $this->mod->get_value($child_a, 0));

        $child_aa = $this->mod->iter_nth_child($child_a, 0);
        $this->assertNotNull($child_aa);
        $this->assertType('GtkTreeIter', $child_aa);
        $this->assertEquals('aa', $this->mod->get_value($child_aa, 0));


        $aa = $this->tmf->convert_child_iter_to_iter($child_aa);
        $this->assertNotNull($aa);
        $this->assertType('GtkTreeIter', $aa);
        $this->assertEquals(
            $this->tmf->get_value($aa, 0),
            $this->mod->get_value($child_aa, 0)
        );

        //This should return NULL if the virtual root would work
        $a = $this->tmf->convert_child_iter_to_iter($child_a);
        //FIXME: check for null when virtual root works
    }

    /**
     * @todo Implement testConvert_child_path_to_path().
     */
    public function testConvert_child_path_to_path() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     *
     */
    public function testConvert_iter_to_child_iter() {
        $a = $this->tmf->get_iter_first();
        $this->assertNotNull($a);
        $this->assertType('GtkTreeIter', $a);
//        var_dump($this->tmf->get_value($a, 0));
        $this->assertEquals('aa', $this->tmf->get_value($a, 0));

        $child_a = $this->tmf->convert_iter_to_child_iter($a);
        $this->assertNotNull($child_a);
        $this->assertType('GtkTreeIter', $child_a);
        $this->assertEquals(
            $this->tmf->get_value($a, 0),
            $this->mod->get_value($child_a, 0)
        );

    }

    /**
     * @todo Implement testConvert_path_to_child_path().
     */
    public function testConvert_path_to_child_path() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testGet_model().
     */
    public function testGet_model() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testRefilter().
     */
    public function testRefilter() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testSet_visible_column().
     */
    public function testSet_visible_column() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testFilter_new().
     */
    public function testFilter_new() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testForeach().
     */
    public function testForeach() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testGet_column_type().
     */
    public function testGet_column_type() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testGet_flags().
     */
    public function testGet_flags() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testGet_iter().
     */
    public function testGet_iter() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testGet_iter_first().
     */
    public function testGet_iter_first() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testGet_iter_root().
     */
    public function testGet_iter_root() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testGet_iter_from_string().
     */
    public function testGet_iter_from_string() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testGet_n_columns().
     */
    public function testGet_n_columns() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testGet_path().
     */
    public function testGet_path() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testGet_string_from_iter().
     */
    public function testGet_string_from_iter() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testGet_value().
     */
    public function testGet_value() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testIter_children().
     */
    public function testIter_children() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testIter_has_child().
     */
    public function testIter_has_child() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testIter_n_children().
     */
    public function testIter_n_children() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testIter_next().
     */
    public function testIter_next() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testIter_nth_child().
     */
    public function testIter_nth_child() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testIter_parent().
     */
    public function testIter_parent() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testRef_node().
     */
    public function testRef_node() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testRow_changed().
     */
    public function testRow_changed() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testRow_deleted().
     */
    public function testRow_deleted() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testRow_has_child_toggled().
     */
    public function testRow_has_child_toggled() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testRow_inserted().
     */
    public function testRow_inserted() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testUnref_node().
     */
    public function testUnref_node() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testDrag_data_delete().
     */
    public function testDrag_data_delete() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testDrag_data_get().
     */
    public function testDrag_data_get() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }

    /**
     * @todo Implement testRow_draggable().
     */
    public function testRow_draggable() {
        // Remove the following line when you implement this test.
        throw new PHPUnit_Framework_IncompleteTestError;
    }
}

// Call GtkTreeModelFilterTest::main() if this source file is executed directly.
if (PHPUnit_MAIN_METHOD == "GtkTreeModelFilterTest::main") {
    GtkTreeModelFilterTest::main();
}
?>