Skip to content
This repository
Newer
Older
100644 76 lines (68 sloc) 1.826 kb
e441c20a »
2012-07-02 Making some initial adjustments and additions for Phar packaging.
1 <?php
2 /**
3 * Prepares a minimalist framework for unit testing.
4 *
5 * Joomla is assumed to include the /unittest/ directory.
6 * eg, /path/to/joomla/unittest/
7 *
8 * @package Joomla.UnitTest
9 *
10 * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
11 * @license GNU General Public License version 2 or later; see LICENSE
12 * @link http://www.phpunit.de/manual/current/en/installation.html
13 */
14
15 // Setup the Pharsanity!
16 Phar::interceptFileFuncs();
17
18 // Set the Joomla execution flag.
19 define('_JEXEC', 1);
20
21 // Fix magic quotes.
22 @ini_set('magic_quotes_runtime', 0);
23
24 // Maximise error reporting.
25 error_reporting(E_ALL & ~E_STRICT);
26 ini_set('display_errors', 1);
27
28 /*
29 * Ensure that required path constants are defined. These can be overridden within the phpunit.xml file
30 * if you chose to create a custom version of that file.
31 */
32 if (!defined('JPATH_TESTS'))
33 {
34 define('JPATH_TESTS', __DIR__);
35 }
36 if (!defined('JPATH_PLATFORM'))
37 {
38 define('JPATH_PLATFORM', 'phar://' . __FILE__ . '/lib');
39 }
40 if (!defined('JPATH_BASE'))
41 {
42 define('JPATH_BASE', JPATH_TESTS . '/tmp');
43 }
44 if (!defined('JPATH_ROOT'))
45 {
46 define('JPATH_ROOT', JPATH_BASE);
47 }
48 if (!defined('JPATH_CACHE'))
49 {
50 define('JPATH_CACHE', JPATH_BASE . '/cache');
51 }
52 if (!defined('JPATH_CONFIGURATION'))
53 {
54 define('JPATH_CONFIGURATION', JPATH_BASE);
55 }
56 if (!defined('JPATH_MANIFESTS'))
57 {
58 define('JPATH_MANIFESTS', JPATH_BASE . '/manifests');
59 }
60 if (!defined('JPATH_PLUGINS'))
61 {
62 define('JPATH_PLUGINS', JPATH_BASE . '/plugins');
63 }
64 if (!defined('JPATH_THEMES'))
65 {
66 define('JPATH_THEMES', JPATH_BASE . '/themes');
67 }
68
69 // Import the platform.
70 require_once JPATH_PLATFORM . '/import.php';
71
72 // Register the core Joomla test classes.
73 JLoader::registerPrefix('Test', 'phar://' . __FILE__ . '/core');
74
75 // End of the Phar Stub.
76 __HALT_COMPILER();?>
Something went wrong with that request. Please try again.