123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?php
- namespace Predis\Command;
- class ServerMonitorTest extends PredisCommandTestCase
- {
-
- protected function getExpectedCommand()
- {
- return 'Predis\Command\ServerMonitor';
- }
-
- protected function getExpectedId()
- {
- return 'MONITOR';
- }
-
- 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 testReturnsTrueAndReadsEventsFromTheConnection()
- {
- $connection = $this->getClient()->getConnection();
- $command = $this->getCommand();
- $this->assertTrue($connection->executeCommand($command));
-
-
- if (version_compare($this->getProfile()->getVersion(), '2.4', '<=')) {
- $this->assertRegExp('/\d+.\d+(\s?\(db \d+\))? "MONITOR"/', $connection->read());
- }
- }
- }
|