Skip to content
Snippets Groups Projects
Commit 1d75aeb2 authored by Jared Hancock's avatar Jared Hancock Committed by Peter Rotich
Browse files

test: Fixup usage of PEAR libs in testing

parent 33be5e1e
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,9 @@ if (!function_exists('get_osticket_root_path')) { ...@@ -16,6 +16,9 @@ if (!function_exists('get_osticket_root_path')) {
} }
} }
$root = 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')) { if (!function_exists('glob_recursive')) {
# Check PHP syntax across all php files # Check PHP syntax across all php files
......
<?php <?php
require_once "class.test.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"; require_once INCLUDE_DIR."class.crypto.php";
class TestCrypto extends Test { class TestCrypto extends Test {
......
...@@ -33,11 +33,12 @@ class TestValidation extends Test { ...@@ -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'));
$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 r@domain.tld'));
$this->assert(Validator::is_email('jared@host')); $this->assert(!Validator::is_email('jared'));
// Odd cases, but legal // 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@[127.0.0.1]'));
$this->assert(Validator::is_email('jared@[ipv6:::1]')); $this->assert(Validator::is_email('jared@[ipv6:::1]'));
$this->assert(Validator::is_email('*@domain.tld')); $this->assert(Validator::is_email('*@domain.tld'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment