/**
  * @test
  */
 public function resetAutoIncrementLazilyCleansUpsAfter100NewRecordsByDefault()
 {
     $oldAutoIncrement = $this->fixture->getAutoIncrement('tx_phpunit_test');
     for ($i = 0; $i < 100; $i++) {
         $latestUid = $this->fixture->createRecord('tx_phpunit_test');
         $this->fixture->deleteRecord('tx_phpunit_test', $latestUid);
     }
     $this->fixture->resetAutoIncrementLazily('tx_phpunit_test');
     $this->assertSame($oldAutoIncrement, $this->fixture->getAutoIncrement('tx_phpunit_test'));
 }
Esempio n. 2
0
 /**
  * @test
  */
 public function resetAutoIncrementLazilyCleansUpsAfterOneNewRecordWithThresholdOfOne()
 {
     $this->subject->resetAutoIncrement('tx_phpunit_test');
     $oldAutoIncrement = $this->subject->getAutoIncrement('tx_phpunit_test');
     $this->subject->setResetAutoIncrementThreshold(1);
     $latestUid = $this->subject->createRecord('tx_phpunit_test');
     $this->subject->deleteRecord('tx_phpunit_test', $latestUid);
     $this->subject->resetAutoIncrementLazily('tx_phpunit_test');
     self::assertSame($oldAutoIncrement, $this->subject->getAutoIncrement('tx_phpunit_test'));
 }