123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- namespace Predis\Command;
- use \PHPUnit_Framework_TestCase as StandardTestCase;
- class ServerFlushDatabaseTest extends CommandTestCase
- {
-
- protected function getExpectedCommand()
- {
- return 'Predis\Command\ServerFlushDatabase';
- }
-
- protected function getExpectedId()
- {
- return 'FLUSHDB';
- }
-
- public function testFilterArguments()
- {
- $command = $this->getCommand();
- $command->setArguments(array());
- $this->assertSame(array(), $command->getArguments());
- }
-
- public function testParseResponse()
- {
- $this->assertTrue($this->getCommand()->parseResponse(true));
- }
-
- public function testFlushesTheEntireLogicalDatabase()
- {
- $redis = $this->getClient();
- $redis->set('foo', 'bar');
- $this->assertTrue($redis->flushdb());
- $this->assertFalse($redis->exists('foo'));
- }
- }
|