Exemplo n.º 1
0
 public function setUp()
 {
     TestSchema::deleteAll([]);
     for ($i = 0; $i < 100; $i++) {
         $model = new TestSchema(['title' => 'Title' . $i, 'object' => ['id' => $i, 'name' => 'Obj' . $i]]);
         $model->save();
         $this->_ids[] = $model->id;
     }
 }
Exemplo n.º 2
0
 public function testIdentityMapOverflow()
 {
     $model = new TestSchema(['title' => 'TitleFirst']);
     $model->save();
     $first_id = $model->_id;
     for ($i = 0; $i < 1000; $i++) {
         $model = new TestSchema(['title' => 'Title' . $i]);
         $model->save();
     }
     $this->assertFalse(TestSchema::getCollection()->getIdentityMap($first_id));
     TestSchema::deleteAll();
 }
Exemplo n.º 3
0
 public function tearDown()
 {
     TestSchema::deleteAll([]);
 }