PMCORE-3842
This commit is contained in:
committed by
Mauricio Veliz
parent
14950242e6
commit
feba9cd581
@@ -1,6 +1,7 @@
|
||||
checksum.txt
|
||||
features/backend/projects/database_connections/main_tests_database_connections_sqlserver.feature
|
||||
features/backend/projects/project_export_import/main_tests_project_export_import.feature
|
||||
gulliver/bin/tasks/pakeTest.php
|
||||
gulliver/core/Session/PmSessionHandler.php
|
||||
gulliver/js/codemirror/addon/hint/pig-hint.js
|
||||
gulliver/js/codemirror/addon/hint/python-hint.js
|
||||
@@ -130,4 +131,5 @@ workflow/engine/xmlform/users/users_List.xml
|
||||
workflow/engine/xmlform/users/users_Options.xml
|
||||
workflow/public_html/skins/JSForms.js
|
||||
workflow/public_html/skins/ajax.js
|
||||
thirdparty/tcpdf
|
||||
thirdparty/tcpdf
|
||||
thirdparty/lime
|
||||
@@ -1,131 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* pakeTest.php
|
||||
* @package gulliver.bin.tasks
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2011 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
pake_desc('launch unit tests');
|
||||
pake_task('test-unit', 'project_exists');
|
||||
|
||||
pake_desc('launch functional tests for an application');
|
||||
pake_task('test-functional', 'project_exists');
|
||||
|
||||
pake_desc('launch all tests');
|
||||
pake_task('test-all', 'project_exists');
|
||||
|
||||
/**
|
||||
* Function run_test_all
|
||||
* access public
|
||||
*/
|
||||
|
||||
function run_test_all($task, $args)
|
||||
{
|
||||
require_once(sfConfig::get('sf_symfony_lib_dir').'/lime/lime.php');
|
||||
|
||||
$h = new lime_harness(new lime_output_color());
|
||||
$h->base_dir = sfConfig::get('sf_test_dir');
|
||||
|
||||
// register all tests
|
||||
$finder = pakeFinder::type('file')->ignore_version_control()->follow_link()->name('*Test.php');
|
||||
$h->register($finder->in($h->base_dir));
|
||||
|
||||
$h->run();
|
||||
}
|
||||
|
||||
function run_test_functional($task, $args)
|
||||
{
|
||||
if (!count($args))
|
||||
{
|
||||
throw new Exception('You must provide the app to test.');
|
||||
}
|
||||
|
||||
$app = $args[0];
|
||||
|
||||
if (!is_dir(sfConfig::get('sf_app_dir').DIRECTORY_SEPARATOR.$app))
|
||||
{
|
||||
throw new Exception(sprintf('The app "%s" does not exist.', $app));
|
||||
}
|
||||
|
||||
if (isset($args[1]))
|
||||
{
|
||||
foreach (array_splice($args, 1) as $path)
|
||||
{
|
||||
$files = pakeFinder::type('file')->ignore_version_control()->follow_link()->name(basename($path).'Test.php')->in(sfConfig::get('sf_test_dir').DIRECTORY_SEPARATOR.'functional'.DIRECTORY_SEPARATOR.$app.DIRECTORY_SEPARATOR.dirname($path));
|
||||
foreach ($files as $file)
|
||||
{
|
||||
include($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once(sfConfig::get('sf_symfony_lib_dir').'/lime/lime.php');
|
||||
|
||||
$h = new lime_harness(new lime_output_color());
|
||||
$h->base_dir = sfConfig::get('sf_test_dir').'/functional/'.$app;
|
||||
|
||||
// register functional tests
|
||||
$finder = pakeFinder::type('file')->ignore_version_control()->follow_link()->name('*Test.php');
|
||||
$h->register($finder->in($h->base_dir));
|
||||
|
||||
$h->run();
|
||||
}
|
||||
}
|
||||
|
||||
function run_test_unit($task, $args)
|
||||
{
|
||||
$environment = isset ( $arg[1] ) ? $arg[1] : G_TEST_ENV;
|
||||
printf("start test in %s environment\n", pakeColor::colorize( $environment, 'INFO'));
|
||||
define ( 'G_ENVIRONMENT', $environment );
|
||||
|
||||
if (isset($args[0]))
|
||||
{
|
||||
foreach ($args as $path)
|
||||
{
|
||||
$pathUnit = PATH_CORE . 'test' . PATH_SEP . 'unit' . PATH_SEP . dirname($path);
|
||||
$files = pakeFinder::type('file')->ignore_version_control()->follow_link()->name(basename($path).'Test.php')->in( $pathUnit );
|
||||
foreach ($files as $file)
|
||||
{
|
||||
$fName = str_replace ( PATH_CORE . 'test' . PATH_SEP . 'unit' . PATH_SEP , '', $file );
|
||||
printf("\ntesting %s \n", pakeColor::colorize( $fName, 'INFO'));
|
||||
include($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
require_once( PATH_THIRDPARTY . '/lime/lime.php');
|
||||
$h = new lime_harness(new lime_output_color());
|
||||
$h->base_dir = $pathUnit = PATH_CORE . 'test' . PATH_SEP . 'unit';
|
||||
// $h->base_dir = $pathUnit = PATH_CORE . 'test' . PATH_SEP . 'unit' . PATH_SEP . "processmaker";
|
||||
|
||||
// register unit tests
|
||||
$finder = pakeFinder::type('file')->ignore_version_control()->follow_link()->name('*Test.php');
|
||||
$h->register($finder->in($h->base_dir));
|
||||
|
||||
$h->run();
|
||||
}
|
||||
}
|
||||
1014
thirdparty/lime/Spyc.class.php
vendored
1014
thirdparty/lime/Spyc.class.php
vendored
File diff suppressed because it is too large
Load Diff
980
thirdparty/lime/lime.php
vendored
980
thirdparty/lime/lime.php
vendored
File diff suppressed because it is too large
Load Diff
93
thirdparty/lime/yaml.class.php
vendored
93
thirdparty/lime/yaml.class.php
vendored
@@ -1,93 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* yaml class.
|
||||
*/
|
||||
|
||||
class sfYaml
|
||||
{
|
||||
/**
|
||||
* Load YAML into a PHP array statically
|
||||
*
|
||||
* The load method, when supplied with a YAML stream (string or file),
|
||||
* will do its best to convert YAML in a file into a PHP array.
|
||||
*
|
||||
* Usage:
|
||||
* <code>
|
||||
* $array = sfYAML::Load('config.yml');
|
||||
* print_r($array);
|
||||
* </code>
|
||||
*
|
||||
* @return array
|
||||
* @param string $input Path of YAML file or string containing YAML
|
||||
*/
|
||||
public static function load($input)
|
||||
{
|
||||
$input = self::getIncludeContents($input);
|
||||
|
||||
// if an array is returned by the config file assume it's in plain php form else in yaml
|
||||
if (is_array($input))
|
||||
{
|
||||
return $input;
|
||||
}
|
||||
|
||||
// syck is prefered over spyc
|
||||
if (function_exists('syck_load'))
|
||||
{
|
||||
$retval = syck_load($input);
|
||||
|
||||
return is_array($retval) ? $retval : array();
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once(dirname(__FILE__).'/Spyc.class.php');
|
||||
|
||||
$spyc = new Spyc();
|
||||
|
||||
return $spyc->load($input);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Dump YAML from PHP array statically
|
||||
*
|
||||
* The dump method, when supplied with an array, will do its best
|
||||
* to convert the array into friendly YAML.
|
||||
*
|
||||
* @return string
|
||||
* @param array $array PHP array
|
||||
*/
|
||||
public static function dump($array)
|
||||
{
|
||||
require_once(dirname(__FILE__).'/Spyc.class.php');
|
||||
|
||||
$spyc = new Spyc();
|
||||
|
||||
return $spyc->dump($array);
|
||||
}
|
||||
|
||||
protected static function getIncludeContents($input)
|
||||
{
|
||||
// if input is a file, process it
|
||||
if (strpos($input, "\n") === false && is_file($input))
|
||||
{
|
||||
ob_start();
|
||||
$retval = include($input);
|
||||
$contents = ob_get_clean();
|
||||
|
||||
// if an array is returned by the config file assume it's in plain php form else in yaml
|
||||
return is_array($retval) ? $retval : $contents;
|
||||
}
|
||||
|
||||
// else return original input
|
||||
return $input;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wraps echo to automatically provide a newline
|
||||
*/
|
||||
function echoln($string)
|
||||
{
|
||||
echo $string."\n";
|
||||
}
|
||||
Reference in New Issue
Block a user