Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 1 addition & 35 deletions test/AllTests.php
Original file line number Diff line number Diff line change
@@ -1,38 +1,5 @@
<?php
if (!extension_loaded('onphp')) {
echo 'Trying to load onPHP extension.. ';

if (!@dl('onphp.so')) {
echo "failed.\n";
} else {
echo "done.\n";
}
}

date_default_timezone_set('Europe/Moscow');
define('ONPHP_TEST_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR);

require ONPHP_TEST_PATH.'../global.inc.php.tpl';

define('ENCODING', 'UTF-8');

mb_internal_encoding(ENCODING);
mb_regex_encoding(ENCODING);

AutoloaderPool::get('onPHP')->addPath(ONPHP_TEST_PATH.'misc');

$testPathes = array(
ONPHP_TEST_PATH.'core'.DIRECTORY_SEPARATOR,
ONPHP_TEST_PATH.'main'.DIRECTORY_SEPARATOR,
ONPHP_TEST_PATH.'main'.DIRECTORY_SEPARATOR.'Autoloader'.DIRECTORY_SEPARATOR,
ONPHP_TEST_PATH.'main'.DIRECTORY_SEPARATOR.'Ip'.DIRECTORY_SEPARATOR,
ONPHP_TEST_PATH.'main'.DIRECTORY_SEPARATOR.'Net'.DIRECTORY_SEPARATOR,
ONPHP_TEST_PATH.'main'.DIRECTORY_SEPARATOR.'Utils'.DIRECTORY_SEPARATOR,
ONPHP_TEST_PATH.'main'.DIRECTORY_SEPARATOR.'Utils'.DIRECTORY_SEPARATOR.'Routers'.DIRECTORY_SEPARATOR,
ONPHP_TEST_PATH.'main'.DIRECTORY_SEPARATOR.'Utils'.DIRECTORY_SEPARATOR.'AMQP'.DIRECTORY_SEPARATOR,
ONPHP_TEST_PATH.'db'.DIRECTORY_SEPARATOR,
);


$config = dirname(__FILE__).'/config.inc.php';

include is_readable($config) ? $config : $config.'.tpl';
Expand Down Expand Up @@ -131,4 +98,3 @@ public static function suite()
AllTests::$dbs = $dbs;
AllTests::$paths = $testPathes;
AllTests::$workers = $daoWorkers;
?>
31 changes: 29 additions & 2 deletions test/config.inc.php.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
<?php


if (!extension_loaded('onphp'))
echo 'Trying to load onPHP extension.. '
.(@dl('onphp.so') ? 'done.' : 'failed!') .PHP_EOL;

date_default_timezone_set('Europe/Moscow');
define('ONPHP_TEST_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR);

require ONPHP_TEST_PATH.'../global.inc.php.tpl';

define('ENCODING', 'UTF-8');

mb_internal_encoding(ENCODING);
mb_regex_encoding(ENCODING);

AutoloaderPool::get('onPHP')->addPath(ONPHP_TEST_PATH.'misc');

$testPathes = array(
ONPHP_TEST_PATH.'core'.DIRECTORY_SEPARATOR,
ONPHP_TEST_PATH.'main'.DIRECTORY_SEPARATOR,
ONPHP_TEST_PATH.'main'.DIRECTORY_SEPARATOR.'Autoloader'.DIRECTORY_SEPARATOR,
ONPHP_TEST_PATH.'main'.DIRECTORY_SEPARATOR.'Ip'.DIRECTORY_SEPARATOR,
ONPHP_TEST_PATH.'main'.DIRECTORY_SEPARATOR.'Net'.DIRECTORY_SEPARATOR,
ONPHP_TEST_PATH.'main'.DIRECTORY_SEPARATOR.'Utils'.DIRECTORY_SEPARATOR,
ONPHP_TEST_PATH.'main'.DIRECTORY_SEPARATOR.'Utils'.DIRECTORY_SEPARATOR.'Routers'.DIRECTORY_SEPARATOR,
ONPHP_TEST_PATH.'main'.DIRECTORY_SEPARATOR.'Utils'.DIRECTORY_SEPARATOR.'AMQP'.DIRECTORY_SEPARATOR,
ONPHP_TEST_PATH.'db'.DIRECTORY_SEPARATOR,
);

$dbs = array(
'PgSQL' => array(
'user' => 'onphp',
Expand Down Expand Up @@ -30,4 +58,3 @@

define('__LOCAL_DEBUG__', true);
define('ONPHP_CURL_TEST_URL', 'http://localhost/curlTest.php'); //set here url to test script test/main/data/curlTest/curlTest.php
?>