123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?php
- namespace Predis\Command;
- class ServerTimeTest extends PredisCommandTestCase
- {
-
- protected function getExpectedCommand()
- {
- return 'Predis\Command\ServerTime';
- }
-
- protected function getExpectedId()
- {
- return 'TIME';
- }
-
- public function testFilterArguments()
- {
- $arguments = array();
- $expected = array();
- $command = $this->getCommand();
- $command->setArguments($arguments);
- $this->assertSame($expected, $command->getArguments());
- }
-
- public function testParseResponse()
- {
- $expected = array(1331114908, 453990);
- $command = $this->getCommand();
- $this->assertSame($expected, $command->parseResponse($expected));
- }
-
- public function testReturnsServerTime()
- {
- $redis = $this->getClient();
- $this->assertInternalType('array', $time = $redis->time());
- $this->assertInternalType('string', $time[0]);
- $this->assertInternalType('string', $time[1]);
- }
- }
|