Przeglądaj źródła

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

Daniele Alessandri 14 lat temu
rodzic
commit
9e58ad7648

+ 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 {