ソースを参照

Test suite: move the trigger guard for the test suite in the common included file.

Daniele Alessandri 14 年 前
コミット
9e58ad7648
3 ファイル変更12 行追加8 行削除
  1. 0 3
      test/PredisClientFeatures.php
  2. 12 2
      test/PredisShared.php
  3. 0 3
      test/RedisCommandsTest.php

+ 0 - 3
test/PredisClientFeatures.php

@@ -1,7 +1,4 @@
 <?php
-define('I_AM_AWARE_OF_THE_DESTRUCTIVE_POWER_OF_THIS_TEST_SUITE', false);
-
-require_once 'PHPUnit/Framework.php';
 require_once 'PredisShared.php';
 require_once '../lib/addons/RedisVersion1_0.php';
 

+ 12 - 2
test/PredisShared.php

@@ -1,10 +1,20 @@
 <?php
-require_once '../lib/Predis.php';
+// -------------------------------------------------------------------------- //
+
+define('I_AM_AWARE_OF_THE_DESTRUCTIVE_POWER_OF_THIS_TEST_SUITE', false);
+
+// -------------------------------------------------------------------------- //
 
 if (I_AM_AWARE_OF_THE_DESTRUCTIVE_POWER_OF_THIS_TEST_SUITE !== true) {
-    exit('Please set the I_AM_AWARE_OF_THE_DESTRUCTIVE_POWER_OF_THIS_TEST_SUITE constant to TRUE if you want to proceed.');
+    exit(
+        "Please set the I_AM_AWARE_OF_THE_DESTRUCTIVE_POWER_OF_THIS_TEST_SUITE " . 
+        "constant to TRUE in PredisShared.php if you want to proceed.\n"
+    );
 }
 
+require_once 'PHPUnit/Framework.php';
+require_once '../lib/Predis.php';
+
 if (!function_exists('array_union')) {
     function array_union(Array $a, Array $b) { 
         return array_merge($a, array_diff($b, $a));

+ 0 - 3
test/RedisCommandsTest.php

@@ -1,7 +1,4 @@
 <?php
-define('I_AM_AWARE_OF_THE_DESTRUCTIVE_POWER_OF_THIS_TEST_SUITE', false);
-
-require_once 'PHPUnit/Framework.php';
 require_once 'PredisShared.php';
 
 class RedisCommandTestSuite extends PHPUnit_Framework_TestCase {