diff --git a/setup/test/run-tests.php b/setup/test/run-tests.php index 3a3df3a1dd09702d7f74bf770b080928dae5bf43..ecd7bb3c73a4f092b8684c3a84f04a010e296d16 100644 --- a/setup/test/run-tests.php +++ b/setup/test/run-tests.php @@ -16,6 +16,9 @@ if (!function_exists('get_osticket_root_path')) { } } $root = get_osticket_root_path(); +define('INCLUDE_DIR', "$root/include/"); +define('PEAR_DIR', INCLUDE_DIR."pear/"); +ini_set('include_path', './'.PATH_SEPARATOR.INCLUDE_DIR.PATH_SEPARATOR.PEAR_DIR); if (!function_exists('glob_recursive')) { # Check PHP syntax across all php files diff --git a/setup/test/tests/test.crypto.php b/setup/test/tests/test.crypto.php index 3a6db88738d37b41cf6f6e95740077b5499dba3d..a8140f6dacc2130b841f2d06c297eb5c731893d2 100644 --- a/setup/test/tests/test.crypto.php +++ b/setup/test/tests/test.crypto.php @@ -1,7 +1,5 @@ <?php require_once "class.test.php"; -define('INCLUDE_DIR', realpath(dirname(__file__).'/../../../include').'/'); -define('PEAR_DIR', INCLUDE_DIR.'/pear/'); require_once INCLUDE_DIR."class.crypto.php"; class TestCrypto extends Test { diff --git a/setup/test/tests/test.validation.php b/setup/test/tests/test.validation.php index 20b1eae9aa85cf36a9355de41c468feb74e5e6a1..6323cd1590856e82ef091e7cce983558fd28c91c 100644 --- a/setup/test/tests/test.validation.php +++ b/setup/test/tests/test.validation.php @@ -33,11 +33,12 @@ class TestValidation extends Test { $this->assert(Validator::is_email('jared_12@domain.tld')); $this->assert(Validator::is_email('jared-12@domain.tld')); - // Very likely illegal + // Illegal or unsupported $this->assert(!Validator::is_email('jared r@domain.tld')); - $this->assert(Validator::is_email('jared@host')); + $this->assert(!Validator::is_email('jared')); // Odd cases, but legal + $this->assert(Validator::is_email('jared@host')); $this->assert(Validator::is_email('jared@[127.0.0.1]')); $this->assert(Validator::is_email('jared@[ipv6:::1]')); $this->assert(Validator::is_email('*@domain.tld'));