1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?php
- namespace Predis\Profiles;
- use \PHPUnit_Framework_TestCase as StandardTestCase;
- abstract class ServerVersionTestCase extends StandardTestCase
- {
-
- protected abstract function getProfileInstance();
-
- protected abstract function getExpectedVersion();
-
- protected abstract function getExpectedCommands();
-
- protected function getCommands(IServerProfile $profile)
- {
- $commands = $profile->getSupportedCommands();
- return array_keys($commands);
- }
-
- public function testGetVersion()
- {
- $profile = $this->getProfileInstance();
- $this->assertEquals($this->getExpectedVersion(), $profile->getVersion());
- }
-
- public function testSupportedCommands()
- {
- $profile = $this->getProfileInstance();
- $expected = $this->getExpectedCommands();
- $commands = $this->getCommands($profile);
- $this->assertSame($expected, $commands);
- }
- }
|