forked from hubzero/framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpunit.php
155 lines (137 loc) · 5.29 KB
/
phpunit.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<?php
/**
* HUBzero CMS
*
* Copyright 2005-2015 HUBzero Foundation, LLC.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* HUBzero is a registered trademark of Purdue University.
*
* @package framework
* @author Sam Wilson <[email protected]>
* @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
* @license http://opensource.org/licenses/MIT MIT
*/
define('DS', DIRECTORY_SEPARATOR);
/*
|--------------------------------------------------------------------------
| Register The Composer Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for the application. We'll require it here so that we do not have to
| worry about the loading of any of the classes "manually".
|
*/
require __DIR__ . DS . 'vendor' . DS . 'autoload.php';
/*
|--------------------------------------------------------------------------
| Include Helper Functions
|--------------------------------------------------------------------------
|
| Include some helper functions. There's really no other good spot to do
| this so it happens here.
|
*/
require __DIR__ . DS . 'src' . DS . 'Base' . DS . 'helpers.php';
/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new application instance which
| serves as the "glue" for all the parts of a hub, and is the IoC container
| for the system binding all of the various parts.
|
*/
$app = new Hubzero\Base\Application;
// Explicitly set the client type to testing as some libs do require this info
$app['client'] = Hubzero\Base\ClientManager::client('testing', true);
/*
|--------------------------------------------------------------------------
| Bind The Application In The Container
|--------------------------------------------------------------------------
|
| This may look strange, but we actually want to bind the app into itself
| in case we need to Facade test an application. This will allow us to
| resolve the "app" key out of this container for this app's facade.
|
*/
$app['app'] = $app;
/*
|--------------------------------------------------------------------------
| Register The Configuration Repository
|--------------------------------------------------------------------------
|
| The configuration repository is used to lazily load in the options for
| this application from the configuration files. The files are easily
| separated by their concerns so they do not become really crowded.
|
*/
$app['config'] = new \Hubzero\Config\Repository('test', new \Hubzero\Config\FileLoader('config'));
/*
|--------------------------------------------------------------------------
| Register The Core Service Providers
|--------------------------------------------------------------------------
|
| Register all of the core pieces of the framework including session,
| caching, and more. First, we'll load the core bootstrap list of services
| and then we'll give the app a chance to modify that list.
|
*/
$services = [
'JoomlaServiceProvider',
'EventServiceProvider',
'TranslationServiceProvider',
'DatabaseServiceProvider',
'PluginServiceProvider',
'ProfilerServiceProvider',
'LogServiceProvider',
'RouterServiceProvider',
'FilesystemServiceProvider',
];
foreach ($services as $service)
{
require_once __DIR__ . '/providers/' . $service . '.php';
$app->register('Framework\\Providers\\' . $service);
}
/*
|--------------------------------------------------------------------------
| Load The Aliases
|--------------------------------------------------------------------------
|
| The alias loader is responsible for lazy loading the class aliases setup
| for the application.
|
*/
$app->registerFacades([
'App' => 'Hubzero\Facades\App',
'Config' => 'Hubzero\Facades\Config',
'Request' => 'Hubzero\Facades\Request',
'Response' => 'Hubzero\Facades\Response',
'Event' => 'Hubzero\Facades\Event',
'Route' => 'Hubzero\Facades\Route',
'User' => 'Hubzero\Facades\User',
'Lang' => 'Hubzero\Facades\Lang',
'Log' => 'Hubzero\Facades\Log',
'Date' => 'Hubzero\Facades\Date',
'Plugin' => 'Hubzero\Facades\Plugin',
'Filesystem' => 'Hubzero\Facades\Filesystem',
]);