From 62bb68344c129d120b02a9d4b1886fd9f865f0c8 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sat, 5 Nov 2022 09:32:30 +0100 Subject: [PATCH] move all scripts into one location - standardize includes, namings - made migrate executable - updated ConfigurationCombinationsTest generator to work with current persistance API --- .gitattributes | 2 ++ .../configuration-test-generator | 8 ++++++-- tst/IconTest => bin/icon-test | 0 bin/{migrate.php => migrate} | 9 +++++---- tst/phpunit.xml | 1 - 5 files changed, 13 insertions(+), 7 deletions(-) rename tst/ConfigurationTestGenerator.php => bin/configuration-test-generator (98%) rename tst/IconTest => bin/icon-test (100%) rename bin/{migrate.php => migrate} (96%) mode change 100644 => 100755 diff --git a/.gitattributes b/.gitattributes index 60629c0..c01ff77 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,5 @@ +bin/configuration-test-generator export-ignore +bin/icon-test export-ignore doc/ export-ignore tst/ export-ignore img/browserstack.svg export-ignore diff --git a/tst/ConfigurationTestGenerator.php b/bin/configuration-test-generator similarity index 98% rename from tst/ConfigurationTestGenerator.php rename to bin/configuration-test-generator index a0106a3..432a229 100755 --- a/tst/ConfigurationTestGenerator.php +++ b/bin/configuration-test-generator @@ -9,7 +9,9 @@ * DANGER: Too many options/settings and too high max iteration setting may trigger * a fork bomb. Please save your work before executing this script. */ -include 'Bootstrap.php'; + +define('PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR); +include PATH . 'tst' . DIRECTORY_SEPARATOR . 'Bootstrap.php'; $vd = array('view', 'delete'); $vcd = array('view', 'create', 'delete'); @@ -392,7 +394,7 @@ class ConfigurationTestGenerator } } $code .= '}' . PHP_EOL; - file_put_contents('ConfigurationCombinationsTest.php', $code); + file_put_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'tst' . DIRECTORY_SEPARATOR . 'ConfigurationCombinationsTest.php', $code); } /** @@ -428,6 +430,8 @@ class ConfigurationCombinationsTest extends PHPUnit_Framework_TestCase Helper::confBackup(); $this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data'; $this->_model = new Filesystem(array('dir' => $this->_path)); + ServerSalt::setStore($this->_model); + TrafficLimiter::setStore($this->_model); $this->reset(); } diff --git a/tst/IconTest b/bin/icon-test similarity index 100% rename from tst/IconTest rename to bin/icon-test diff --git a/bin/migrate.php b/bin/migrate old mode 100644 new mode 100755 similarity index 96% rename from bin/migrate.php rename to bin/migrate index 193430e..4dbe052 --- a/bin/migrate.php +++ b/bin/migrate @@ -1,7 +1,8 @@ +#!/usr/bin/env php ] - php migrate.php [-h] + migrate [--delete-after] [--delete-during] [-f] [-n] [-v] srcconfdir + [] + migrate [-h] Options: --delete-after delete data from source after all pastes and comments have diff --git a/tst/phpunit.xml b/tst/phpunit.xml index caaa67d..20eb4d5 100644 --- a/tst/phpunit.xml +++ b/tst/phpunit.xml @@ -1,7 +1,6 @@ ./ - ConfigurationTestGenerator.php