ARedisLogRouteTest.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. require_once("common.php");
  3. /**
  4. * Tests for the {@link ARedisLogRoute} class
  5. * @author Charles Pick
  6. * @package packages.redis.tests
  7. */
  8. class ARedisLogRouteTest extends CTestCase {
  9. /**
  10. * Holds the redis connection
  11. * @var ARedisConnection
  12. */
  13. protected $_connection;
  14. /**
  15. * Tests the basic functionality
  16. */
  17. public function testBasics() {
  18. $redis = $this->getConnection();
  19. $route = new ARedisLogRoute();
  20. // TODO: Some actual tests!
  21. }
  22. /**
  23. * Sets the redis connection to use with this test
  24. * @param ARedisConnection $connection the connection
  25. */
  26. public function setConnection($connection)
  27. {
  28. $this->_connection = $connection;
  29. }
  30. /**
  31. * Gets the redis connection to use with this test
  32. * @return ARedisConnection the redis connection
  33. */
  34. public function getConnection()
  35. {
  36. if ($this->_connection === null) {
  37. $this->_connection = Yii::createComponent(
  38. array(
  39. "class" => "packages.redis.ARedisConnection",
  40. "hostname" => REDIS_HOSTNAME,
  41. "port" => REDIS_PORT,
  42. "database" => REDIS_DATABASE,
  43. "password" => REDIS_PASSWORD
  44. ));
  45. }
  46. return $this->_connection;
  47. }
  48. }