mirror of
https://github.com/predis/predis.git
synced 2026-09-11 19:07:30 +00:00
Fix tests for latest changes, added phpunit.xml.dist file and autoloader in test/bootstrap.php
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<phpunit bootstrap="test/bootstrap.php">
|
||||
<testsuites>
|
||||
<testsuite name="Predis Test Suite">
|
||||
<directory>test/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory suffix=".php">lib/Predis/</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
require_once 'PredisShared.php';
|
||||
|
||||
class PredisClientFeaturesTestSuite extends PHPUnit_Framework_TestCase {
|
||||
public $redis;
|
||||
|
||||
@@ -13,7 +13,6 @@ if (I_AM_AWARE_OF_THE_DESTRUCTIVE_POWER_OF_THIS_TEST_SUITE !== true) {
|
||||
}
|
||||
|
||||
require_once 'PHPUnit/Framework.php';
|
||||
require_once '../lib/Predis.php';
|
||||
|
||||
if (!function_exists('array_union')) {
|
||||
function array_union(Array $a, Array $b) {
|
||||
@@ -80,7 +79,7 @@ class RC {
|
||||
$redisUri = sprintf('redis://%s:%d/?database=%d', RC::SERVER_HOST, RC::SERVER_PORT, RC::DEFAULT_DATABASE);
|
||||
$handle = popen('php', 'w');
|
||||
fwrite($handle, "<?php
|
||||
require '../lib/Predis.php';
|
||||
require 'bootstrap.php';
|
||||
\$redis = new Predis\Client('$redisUri');
|
||||
\$redis->rpush('{$op}1', 'a');
|
||||
\$redis->rpush('{$op}2', 'b');
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
require_once 'PredisShared.php';
|
||||
|
||||
class RedisCommandTestSuite extends PHPUnit_Framework_TestCase {
|
||||
public $redis;
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function($class)
|
||||
{
|
||||
$file = __DIR__.'/../lib/'.strtr($class, '\\', '/').'.php';
|
||||
if (file_exists($file)) {
|
||||
require $file;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
require __DIR__.'/PredisShared.php';
|
||||
Reference in New Issue
Block a user