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; } }
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(); }
public function tearDown() { TestSchema::deleteAll([]); }