-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpunit.php
66 lines (53 loc) · 1.41 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
<?php
/**
* Test bootstrap for Beautiful Domain
*
* You will find a number of Mock (but real) objects used in
* various tests. In the future I plan to place these in their
* own directory.
*
* @package Beautiful
* @subpackage Beautiful Domain
* @category Test
* @author Luke Morton
* @copyright Luke Morton, 2011
* @license MIT
*/
define('EXT', '.php');
define('APPPATH', __DIR__.'/test/');
define('SYSPATH', __DIR__.'/test/system/');
error_reporting(E_ALL | E_STRICT);
require SYSPATH.'classes/kohana/core.php';
require SYSPATH.'classes/kohana.php';
spl_autoload_register(array('Kohana', 'auto_load'));
I18n::lang('en-gb');
Kohana::$config = new Kohana_Config;
Kohana::$config->attach(new Config_File);
Kohana::modules(array('beautiful-domain' => __DIR__.'/'));
class Field_Mock extends Field {}
class Relationship_Mock extends Relationship {}
class Model_User extends Domain {
public static function fields()
{
return array(
new Field_Mock('name', array(
'accessor' => TRUE,
'filters' => array(
array('set', 'ucwords'),
),
)),
new Field_Mock('automobile', array('accessor' => 'car')),
new Relationship_HasOne('friend', array(
'accessor' => TRUE,
'domain' => 'Model_User',
)),
);
}
}
class Registry_Mock extends Registry {
// Making ::mapper() public for introspection
public function mapper($class = NULL)
{
return parent::mapper($class);
}
}