123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?php
- namespace Predis\Profile;
- use PredisTestCase;
- abstract class PredisProfileTestCase extends PredisTestCase
- {
-
- protected function getProfile($version = null)
- {
- $this->markTestIncomplete("Server profile must be defined in ".get_class($this));
- }
-
- abstract protected function getExpectedVersion();
-
- abstract protected function getExpectedCommands();
-
- protected function getCommands(ServerProfileInterface $profile)
- {
- $commands = $profile->getSupportedCommands();
- return array_keys($commands);
- }
-
- public function testGetVersion()
- {
- $profile = $this->getProfile();
- $this->assertEquals($this->getExpectedVersion(), $profile->getVersion());
- }
-
- public function testSupportedCommands()
- {
- $profile = $this->getProfile();
- $expected = $this->getExpectedCommands();
- $commands = $this->getCommands($profile);
- $this->assertSame($expected, $commands);
- }
- }
|