123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
- namespace Predis\Command;
- class ConnectionSelectTest extends PredisCommandTestCase
- {
-
- protected function getExpectedCommand()
- {
- return 'Predis\Command\ConnectionSelect';
- }
-
- protected function getExpectedId()
- {
- return 'SELECT';
- }
-
- public function testFilterArguments()
- {
- $arguments = array(10);
- $expected = array(10);
- $command = $this->getCommand();
- $command->setArguments($arguments);
- $this->assertSame($expected, $command->getArguments());
- }
-
- public function testParseResponse()
- {
- $command = $this->getCommand();
- $this->assertTrue($command->parseResponse(true));
- }
-
- public function testCanSelectDifferentDatabase()
- {
- $redis = $this->getClient();
- $redis->set('foo', 'bar');
- $this->assertTrue($redis->select(REDIS_SERVER_DBNUM - 1));
- $this->assertFalse($redis->exists('foo'));
- }
-
- public function testThrowsExceptionOnUnexpectedDatabase()
- {
- $redis = $this->getClient();
- $redis->select(100000000);
- }
- }
|