123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?php
- namespace Predis\Command\Redis;
- class MONITOR_Test extends PredisCommandTestCase
- {
-
- protected function getExpectedCommand()
- {
- return 'Predis\Command\Redis\MONITOR';
- }
-
- protected function getExpectedId()
- {
- return 'MONITOR';
- }
-
- public function testFilterArguments()
- {
- $command = $this->getCommand();
- $command->setArguments(array());
- $this->assertSame(array(), $command->getArguments());
- }
-
- public function testParseResponse()
- {
- $this->assertSame('OK', $this->getCommand()->parseResponse('OK'));
- }
-
- public function testReturnsStatusResponseAndReadsEventsFromTheConnection()
- {
- $connection = $this->getClient()->getConnection();
- $command = $this->getCommand();
- $this->assertEquals('OK', $connection->executeCommand($command));
-
-
- if ($this->isRedisServerVersion('<=', '2.4.0')) {
- $this->assertRegExp('/\d+.\d+(\s?\(db \d+\))? "MONITOR"/', $connection->read());
- }
- }
- }
|