Location: PHPKode > projects > MongoDB PHP Driver > mongodb-mongo-php-driver-a593f23/tests/MongoLogTest.php
<?php
require_once 'PHPUnit/Framework.php';

/**
 * Test class for Mongo.
 * Generated by PHPUnit on 2009-04-09 at 18:09:02.
 */
class MongoLogTest extends PHPUnit_Framework_TestCase
{
    /**
     * @var    Mongo
     * @access protected
     */
    protected $object;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     *
     * @access protected
     */
    public function setUp() {
        $this->object = new Mongo();
    }

    public function tearDown() {
        MongoLog::setLevel(MongoLog::NONE);
        MongoLog::setModule(MongoLog::NONE);
    }

    /**
     * @expectedException PHPUnit_Framework_Error
     */
    public function testLog() {
        MongoLog::setLevel(MongoLog::IO);
        MongoLog::setModule(MongoLog::FINE);

        $this->object->foo->bar->insert(array("x" => 1));
    }

    public function testLog2() {
        MongoLog::setLevel(MongoLog::NONE);
        MongoLog::setModule(MongoLog::NONE);

        $this->object->foo->bar->insert(array("x" => 1));
        // this should be fine
    }

}

?>
Return current item: MongoDB PHP Driver