mirror of
https://github.com/predis/predis.git
synced 2026-08-30 04:02:22 +00:00
Change the way we enable/disable the safety catch to run the test suite.
Now we check for the presence of the file "test/enable.tests" to enable the test suite instead of relying on the value of a constant defined in PHP. In this way we can prevent commiting an enabled test suite by mistake since the above mentioned file is not tracked by Git (see .gitignore)..
This commit is contained in:
@@ -1 +1,2 @@
|
||||
experiments/
|
||||
test/enable.tests
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
<?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) {
|
||||
if (!file_exists(__DIR__.'/enable.tests')) {
|
||||
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"
|
||||
"Please create an empty file named 'enabled.tests' inside the test directory ".
|
||||
"in order to proceed.\n\n*** DO NOT *** run this test suite against servers in ".
|
||||
"a production environment or containing data you are interested in!\n"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user