Follows-up
c4e698dc2. The tests are failing on Travis CI because
php5-redis isn't installed by default. These tests shouldn't need
that to be installed (and even then, we should skip gracefully as
it is an optional dependency).
> RedisBagOStuffTest::testUnserialize with data set #0
> Exception: RedisConnectionPool requires a Redis client library.
> ./mediawiki/includes/clientpool/RedisConnectionPool.php:86
Fixed by using a mock and disabling the original constructor.
Change-Id: Icced7c30a75516c2118489ad29eac2aa5cff80ad
/**
* @group BagOStuff
*/
-class RedisBagOStuffTest extends MediaWikiTestCase {
+class RedisBagOStuffTest extends PHPUnit_Framework_TestCase {
/** @var RedisBagOStuff */
private $cache;
protected function setUp() {
parent::setUp();
- $this->cache = TestingAccessWrapper::newFromObject( new RedisBagOStuff( [ 'servers' => [] ] ) );
+ $cache = $this->getMockBuilder( 'RedisBagOStuff' )
+ ->disableOriginalConstructor()
+ ->getMock();
+ $this->cache = TestingAccessWrapper::newFromObject( $cache );
}
/**