123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace Predis\Command;
- use \PHPUnit_Framework_TestCase as StandardTestCase;
- class PrefixableCommandTest extends StandardTestCase
- {
-
- public function testImplementsCorrectInterface()
- {
- $command = $this->getMockForAbstractClass('Predis\Command\PrefixableCommand');
- $this->assertInstanceOf('Predis\Command\PrefixableCommandInterface', $command);
- $this->assertInstanceOf('Predis\Command\CommandInterface', $command);
- }
-
- public function testAddPrefixToFirstArgument()
- {
- $command = $this->getMockForAbstractClass('Predis\Command\PrefixableCommand');
- $command->setRawArguments(array('key', 'value'));
- $command->prefixKeys('prefix:');
- $this->assertSame(array('prefix:key', 'value'), $command->getArguments());
- }
-
- public function testDoesNotBreakOnEmptyArguments()
- {
- $command = $this->getMockForAbstractClass('Predis\Command\PrefixableCommand');
- $command->prefixKeys('prefix:');
- $this->assertEmpty($command->getArguments());
- }
- }
|