diff --git a/src/Tables/TableFactory.php b/src/Tables/TableFactory.php index baf68f038..0433a6ea5 100644 --- a/src/Tables/TableFactory.php +++ b/src/Tables/TableFactory.php @@ -14,8 +14,8 @@ public static function make($size) static::ensureDependenciesAreLoaded(); return extension_loaded('openswoole') - ? new OpenSwooleTable($size) - : new SwooleTable($size); + ? new OpenSwooleTable($size, 1) + : new SwooleTable($size, 1); } /** diff --git a/tests/TableTest.php b/tests/TableTest.php index 92f342095..843d3b873 100644 --- a/tests/TableTest.php +++ b/tests/TableTest.php @@ -63,6 +63,17 @@ public function test_it_gets_used_while_creating_an_timer_table() return $this->assertInstanceOf(SwooleTable::class, $table); } + public function test_can_use_all_available_rows() + { + $table = $this->createSwooleTable(); + + for ($i = 0; $i < 1000; $i++) { + $table->set($i, ['string' => 'foo']); + } + + $this->assertSame(1000, $table->count()); + } + /** * @dataProvider validStringValues */