コード例 #1
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @access protected
  */
 protected function setUp()
 {
     $m = new Mongo();
     $this->object = $m->selectCollection('phpunit', 'c');
     $this->object->drop();
     //        $this->object->start = memory_get_usage(true);
 }
コード例 #2
0
 public function testDrop()
 {
     $this->object->storeFile('tests/somefile');
     $c = $this->object->chunks->count();
     $this->assertGreaterThan(0, $c);
     $this->assertEquals($this->count(), 1);
     $this->object->drop();
     $this->assertEquals($this->object->chunks->count(), 0);
     $this->assertEquals($this->object->count(), 0);
 }
コード例 #3
0
 public function testExplainLimit()
 {
     $this->object->drop();
     for ($i = 0; $i < 100; $i++) {
         $this->object->save(array("x" => $i));
     }
     $q = array("x" => array('$gt' => 50));
     $soft = $this->object->find($q)->limit(20)->explain();
     $hard = $this->object->find($q)->limit(-20)->explain();
     $this->assertEquals(20, $soft['n']);
     $this->assertEquals(20, $hard['n']);
 }
コード例 #4
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @access protected
  */
 protected function setUp()
 {
     $this->object = $this->sharedFixture->selectCollection('phpunit', 'c');
     $this->object->drop();
     //        $this->object->start = memory_get_usage(true);
 }
コード例 #5
0
ファイル: SlowTests.php プロジェクト: kph11/mongo-php-driver
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @access protected
  */
 protected function setUp()
 {
     $m = new Mongo();
     $this->object = $m->selectCollection('phpunit', 'c');
     $this->object->drop();
 }