12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <?php
- namespace Predis\Commands;
- use \PHPUnit_Framework_TestCase as StandardTestCase;
- class ConnectionEchoTest extends CommandTestCase
- {
-
- protected function getExpectedCommand()
- {
- return 'Predis\Commands\ConnectionEcho';
- }
-
- protected function getExpectedId()
- {
- return 'ECHO';
- }
-
- public function testFilterArguments()
- {
- $arguments = array('message');
- $expected = array('message');
- $command = $this->getCommand();
- $command->setArguments($arguments);
- $this->assertSame($expected, $command->getArguments());
- }
-
- public function testParseResponse()
- {
- $raw = 'message';
- $expected = 'message';
- $command = $this->getCommand();
- $this->assertSame($expected, $command->parseResponse($raw));
- }
-
- public function testAlwaysReturnsThePassedMessage()
- {
- $redis = $this->getClient();
- $message = 'Can you hear me?';
- $this->assertSame($message, $redis->echo($message));
- }
- }
|