示例#1
0
 /**
  * Build the test suite.
  *
  * @return PHPUnit_Framework_TestSuite
  * @access public
  */
 public static function suite()
 {
     $suite = new AllTests('VuFind');
     $suite->addTest(SeleniumAllTests::suite());
     $suite->addTest(WebAllTests::suite());
     return $suite;
 }
示例#2
0
 public static function suite()
 {
     $suite = new AllTests('Models');
     $suite->addTest(User_AllTests::suite());
     $suite->addTest(Element_AllTests::suite());
     $suite->addTest(Webservice_AllTests::suite());
     return $suite;
 }
 /**
  * TestSuite
  */
 public static function suite()
 {
     $suite = new AllTests('PHPUnit');
     $base = dirname(__FILE__);
     $files = sfFinder::type('file')->name('*Test.php')->in(array(DIR . '/plugins/sfPhpunitPlugin/test', $base . '/unit', $base . '/functional'));
     foreach ($files as $file) {
         $suite->addTestFile($file);
     }
     return $suite;
 }
示例#4
0
 /**
  * TestSuite
  */
 public static function suite()
 {
     $suite = new AllTests('EasyFinance');
     $base = dirname(__FILE__);
     $files = sfFinder::type('file')->name('*Test.php')->in(array($base . '/unit', $base . '/functional'));
     $suite->addTest(EasyFinance_Unit_AllTests::suite());
     foreach ($files as $file) {
         $suite->addTestFile($file);
     }
     return $suite;
 }
示例#5
0
 /**
  *  Install the test database
  */
 public static function installDB()
 {
     static $dbInit = false;
     if (!$dbInit) {
         echo PHP_EOL . "Installing civicrm_tests_dev database" . PHP_EOL;
         //  create test database
         self::$utils = new Utils($GLOBALS['mysql_host'], $GLOBALS['mysql_user'], $GLOBALS['mysql_pass']);
         $query = "DROP DATABASE IF EXISTS civicrm_tests_dev;" . "CREATE DATABASE civicrm_tests_dev DEFAULT" . " CHARACTER SET utf8 COLLATE utf8_unicode_ci;" . "USE civicrm_tests_dev;" . "SET SQL_MODE='STRICT_ALL_TABLES';" . "SET foreign_key_checks = 1";
         if (self::$utils->do_query($query) === false) {
             //  failed to create test database
             exit;
         }
         //  initialize test database
         $sql_file = dirname(dirname(dirname(__FILE__))) . "/sql/civicrm.mysql";
         $sql_file1 = dirname(dirname(dirname(__FILE__))) . "/sql/civicrm_data.mysql";
         $query = file_get_contents($sql_file);
         $query1 = file_get_contents($sql_file1);
         if (self::$utils->do_query($query) === false) {
             //  failed to initialze test database
             exit;
         }
         if (self::$utils->do_query($query1) === false) {
             //  failed to initialze test database
             exit;
         }
         $dbInit = true;
     }
     return self::$db_conn;
 }
示例#6
0
 /**
  */
 private static function getInstance()
 {
     if (is_null(self::$instance)) {
         self::$instance = new self();
     }
     return self::$instance;
 }
示例#7
0
 static function suite()
 {
     if (isset($GLOBALS[self::GLOBALS_TEST_PATHS_INDEX])) {
         self::$testPaths = $GLOBALS[self::GLOBALS_TEST_PATHS_INDEX];
     }
     Exceptionizer::getInstance()->register(E_ALL | E_STRICT, false, 'InternalOperationException');
     return new PhoebiusTestSuite(self::$testPaths);
 }
示例#8
0
 public static function suite()
 {
     $suite = new PHPUnit_Framework_TestSuite('ErdikoTests');
     $testFiles = AllTests::_getTestFiles();
     foreach ($testFiles as $file) {
         $suite->addTestFile($file);
     }
     return $suite;
 }
            $_SERVER['argv'][2] = $metaDir . 'config.meta.xml';
            $_SERVER['argv'][] = '--force';
            $_SERVER['argv'][] = '--no-schema-check';
            $_SERVER['argv'][] = '--drop-stale-files';
            include $path;
            AutoloaderPool::get('onPHP')->addPaths(array(ONPHP_META_AUTO_BUSINESS_DIR, ONPHP_META_AUTO_DAO_DIR, ONPHP_META_AUTO_PROTO_DIR, ONPHP_META_DAO_DIR, ONPHP_META_BUSINESS_DIR, ONPHP_META_PROTO_DIR));
            $dBCreator = DBTestCreator::create()->setSchemaPath(ONPHP_META_AUTO_DIR . 'schema.php')->setTestPool(DBTestPool::me());
            $out = MetaConfiguration::me()->getOutput();
            foreach (DBTestPool::me()->getPool() as $connector => $db) {
                DBPool::me()->setDefault($db);
                $out->info('Using ')->info(get_class($db), true)->infoLine(' connector.');
                $dBCreator->dropDB(true);
                $dBCreator->createDB()->fillDB();
                MetaConfiguration::me()->checkIntegrity();
                $out->newLine();
                $dBCreator->dropDB();
            }
            DBPool::me()->dropDefault();
        }
        foreach (self::$paths as $testPath) {
            foreach (glob($testPath . '*Test' . EXT_CLASS, GLOB_BRACE) as $file) {
                $suite->addTestFile($file);
            }
        }
        return $suite;
    }
}
AllTests::$dbs = $dbs;
AllTests::$paths = $testPathes;
AllTests::$workers = $daoWorkers;
示例#10
0
<?php

/* ***********************************************************************************************
 *
 * Phoebius Framework
 *
 * **********************************************************************************************
 *
 * Copyright (c) 2009 Scand Ltd.
 *
 * This program is free software; you can redistribute it and/or modify it under the terms
 * of the GNU Lesser General Public License as published by the Free Software Foundation;
 * either version 3 of the License, or (at your option) any later version.
 *
 * You should have received a copy of the GNU Lesser General Public License along with
 * this program; if not, see <http://www.gnu.org/licenses/>.
 *
 ************************************************************************************************/
require dirname(__FILE__) . '/appless.init.php';
// This is needed because ZendPhpUnit launcher does not check the indexes of
// arrays it accesses to :( any access to unexistant index throws an exception
// TODO 1: add halt/unhalt() method pair to avoid direct register()/unregister() calls
//         (such calls are expensive)
// TODO 2: add "kernel" mode - an abstraction over Exceptionizer::halt()/unhalt()
Exceptionizer::getInstance()->unregister();
AllTests::$testPaths = array(PHOEBIUS_BASE_ROOT . DIRECTORY_SEPARATOR . 'tests');
set_include_path(PHOEBIUS_BASE_ROOT . DIRECTORY_SEPARATOR . 'tests' . PATH_SEPARATOR . get_include_path());
示例#11
0
<?php

// $Id$
if (!defined('TEST')) {
    define('TEST', __FILE__);
}
require_once dirname(__FILE__) . '/test_groups.php';
require_once dirname(__FILE__) . '/../reporter.php';
$test = new AllTests();
if (SimpleReporter::inCli()) {
    $result = $test->run(new SelectiveReporter(new TextReporter(), @$argv[1], @$argv[2]));
    return $result ? 0 : 1;
}
$test->run(new SelectiveReporter(new HtmlReporter(), @$_GET['c'], @$_GET['t']));
示例#12
0
function Testsuite_registerTests($name)
{
    AllTests::addTestsuite($name);
}
示例#13
0
 public static function suite()
 {
     $suite = new AllTests();
     // Append all HAR Viewer tests into the suite.
     $suite->addTestSuite("HAR_Test1");
     $suite->addTestSuite("HAR_TestExamples");
     $suite->addTestSuite("HAR_TestPageListService");
     $suite->addTestSuite("HAR_TestPreviewSource");
     $suite->addTestSuite("HAR_TestRemoteLoad");
     $suite->addTestSuite("HAR_TestLoadMultipleFiles");
     $suite->addTestSuite("HAR_TestNoPageLog");
     $suite->addTestSuite("HAR_TestPageTimings");
     $suite->addTestSuite("HAR_TestSchemaTab");
     $suite->addTestSuite("HAR_TestRequestBody");
     $suite->addTestSuite("HAR_TestRemoveTab");
     $suite->addTestSuite("HAR_TestHideTabBar");
     $suite->addTestSuite("HAR_TestShowStatsAndTimeline");
     $suite->addTestSuite("HAR_TestCustomPageTiming");
     $suite->addTestSuite("HAR_TestRemoveToolbarButton");
     $suite->addTestSuite("HAR_TestTimeStamps");
     $suite->addTestSuite("HAR_TestPhases");
     //$suite->addTestSuite("HAR_TestLoadHarAPI");
     $suite->addTestSuite("HAR_TestNoPageGraph");
     $suite->addTestSuite("HAR_TestEmbeddedPreview");
     $suite->addTestSuite("HAR_TestCustomizeColumns");
     $suite->addTestSuite("HAR_TestSearchHAR");
     $suite->addTestSuite("HAR_TestPreviewExpand");
     $suite->addTestSuite("HAR_TestEmbeddedInvalidPreview");
     $suite->addTestSuite("HAR_TestSearchJsonQuery");
     return $suite;
 }
示例#14
0
 /**
  *  Create database connection for this instance
  *
  *  @return PHPUnit_Extensions_Database_DB_IDatabaseConnection connection
  */
 protected function getConnection()
 {
     AllTests::installDB();
     return $this->createDefaultDBConnection(AllTests::$utils->pdo, 'civicrm_tests_dev');
 }
        return parent::_getCss() . ' .pass { color: green; }';
    }
}
class ShowSimplePasses extends TextReporter
{
    var $lastfile = '';
    function paintPass($message)
    {
        parent::paintPass($message);
        $breadcrumb = $this->getTestList();
        array_shift($breadcrumb);
        if ($this->lastfile != $breadcrumb[0]) {
            print "{$breadcrumb['0']}\n";
            $this->lastfile = $breadcrumb[0];
        }
        array_shift($breadcrumb);
        print "\t" . implode(":", $breadcrumb) . ": OK\n";
        //print ": $message\n";
    }
}
class AllTests extends TestSuite
{
    function AllTests()
    {
        $this->TestSuite('All tests');
        $this->addFile('tests/activerecord.php');
        //        $this->addFile('tests/livetest.php');
    }
}
$test = new AllTests();
$test->run(new ShowSimplePasses());
示例#16
0
<?php

/**
Copyright 2011-2015 Nick Korbel

This file is part of Booked Scheduler.

Booked Scheduler is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Booked Scheduler 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 General Public License for more details.

You should have received a copy of the GNU General Public License
along with Booked Scheduler.  If not, see <http://www.gnu.org/licenses/>.
*/
define('ROOT_DIR', dirname(__FILE__) . '/../');
require_once ROOT_DIR . 'tests/AllTests.php';
$suite = AllTests::suite();
$suite->run();
示例#17
0
<?php

// $Id: all_tests.php,v 1.2 2004/08/16 08:55:24 hfuecks Exp $
require_once 'simple_include.php';
require_once 'calendar_include.php';
define("TEST_RUNNING", true);
require_once './calendar_tests.php';
require_once './calendar_tabular_tests.php';
require_once './validator_tests.php';
require_once './calendar_engine_tests.php';
require_once './calendar_engine_tests.php';
require_once './table_helper_tests.php';
require_once './decorator_tests.php';
require_once './util_tests.php';
class AllTests extends GroupTest
{
    function AllTests()
    {
        $this->GroupTest('All PEAR::Calendar Tests');
        $this->AddTestCase(new CalendarTests());
        $this->AddTestCase(new CalendarTabularTests());
        $this->AddTestCase(new ValidatorTests());
        $this->AddTestCase(new CalendarEngineTests());
        $this->AddTestCase(new TableHelperTests());
        $this->AddTestCase(new DecoratorTests());
        $this->AddTestCase(new UtilTests());
    }
}
$test = new AllTests();
$test->run(new HtmlReporter());
示例#18
0
 public static function suite()
 {
     $suite = new AllTests();
     $tdir = dirname(__FILE__);
     $suite->addTestFile($tdir . '/BookmarkTest.php');
     $suite->addTestFile($tdir . '/Bookmark2TagTest.php');
     $suite->addTestFile($tdir . '/Tag2TagTest.php');
     $suite->addTestFile($tdir . '/TagsCacheTest.php');
     $suite->addTestFile($tdir . '/CommonDescriptionTest.php');
     $suite->addTestFile($tdir . '/SearchHistoryTest.php');
     $suite->addTestFile($tdir . '/TagTest.php');
     $suite->addTestFile($tdir . '/VoteTest.php');
     $suite->addTestFile($tdir . '/UserTest.php');
     $suite->addTestFile($tdir . '/Api/ExportCsvTest.php');
     $suite->addTestFile($tdir . '/Api/OpenSearchTest.php');
     $suite->addTestFile($tdir . '/Api/PostsAddTest.php');
     $suite->addTestFile($tdir . '/Api/PostsDeleteTest.php');
     $suite->addTestFile($tdir . '/Api/PostsUpdateTest.php');
     return $suite;
 }
示例#19
0
if (!defined('PHPUnit_MAIN_METHOD')) {
    define('PHPUnit_MAIN_METHOD', 'AllTests::main');
}
/**
 * @see ZendX_AllTests
 */
require_once 'ZendX/AllTests.php';
class AllTests
{
    public static function main()
    {
        $parameters = array();
        if (TESTS_GENERATE_REPORT && extension_loaded('xdebug')) {
            $parameters['reportDirectory'] = TESTS_GENERATE_REPORT_TARGET;
        }
        if (defined('TESTS_ZEND_LOCALE_FORMAT_SETLOCALE') && TESTS_ZEND_LOCALE_FORMAT_SETLOCALE) {
            // run all tests in a special locale
            setlocale(LC_ALL, TESTS_ZEND_LOCALE_FORMAT_SETLOCALE);
        }
        PHPUnit_TextUI_TestRunner::run(self::suite(), $parameters);
    }
    public static function suite()
    {
        $suite = new PHPUnit_Framework_TestSuite('Zend Framework Extras');
        $suite->addTest(ZendX_AllTests::suite());
        return $suite;
    }
}
if (PHPUnit_MAIN_METHOD == 'AllTests::main') {
    AllTests::main();
}
示例#20
0
<?php

require_once 'PHPUnit/Framework.php';
require_once 'PHPUnit/TextUI/TestRunner.php';
require_once 'init.php';
require_once 'test/alltests.class.php';
$result = PHPUnit_TextUI_TestRunner::run(AllTests::suite());