Skip to content

Commit dd89dc2

Browse files
committed
test: add test for --limit-lows
1 parent 1a7b9c8 commit dd89dc2

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

tests/system/Commands/Database/ShowTableInfoTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,24 @@ public function testDbTableLimitFieldValueLength(): void
149149
EOL;
150150
$this->assertStringContainsString($expected, $result);
151151
}
152+
153+
public function testDbTableLimitRows(): void
154+
{
155+
command('db:table db_user --limit-rows 2');
156+
157+
$result = $this->getResultWithoutControlCode();
158+
159+
$expected = 'Data of Table "db_user":';
160+
$this->assertStringContainsString($expected, $result);
161+
162+
$expected = <<<'EOL'
163+
+----+-------------+--------------------+---------+------------+------------+------------+
164+
| id | name | email | country | created_at | updated_at | deleted_at |
165+
+----+-------------+--------------------+---------+------------+------------+------------+
166+
| 1 | Derek Jones | derek@world.com | US | | | |
167+
| 2 | Ahmadinejad | ahmadinejad@wor... | Iran | | | |
168+
+----+-------------+--------------------+---------+------------+------------+------------+
169+
EOL;
170+
$this->assertStringContainsString($expected, $result);
171+
}
152172
}

0 commit comments

Comments
 (0)