1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10:
11: class Whups_TestBase Extends PHPUnit_Framework_TestCase {
12:
13: function setUp()
14: {
15: require_once dirname(__FILE__) . '/../Application.php';
16: Horde_Registry::appInit('whups', array('cli' => true));
17: }
18:
19: 20: 21: 22: 23: 24: 25:
26: function assertOk($result)
27: {
28: if (is_a($result, 'DB_Error')) {
29: $this->fail($result->getDebugInfo());
30: return false;
31: } elseif (is_a($result, 'PEAR_Error')) {
32: $this->fail($result->getMessage());
33: return false;
34: }
35:
36: return true;
37: }
38:
39: }
40:
41: class Whups_Driver_sql {
42:
43: var $_queues = array(
44: array('queue_id' => 1,
45: 'queue_name' => 'queue one',
46: 'queue_description' => 'queue one description',
47: 'queue_versioned' => 1),
48: array('queue_id' => 3,
49: 'queue_name' => 'queue three',
50: 'queue_description' => 'queue three description',
51: 'queue_versioned' => 0));
52:
53: function initialise()
54: {
55: return true;
56: }
57:
58: function getQueuesInternal()
59: {
60: foreach ($this->_queues as $queue) {
61: $q[$queue['queue_id']] = $queue['queue_name'];
62: }
63: return $q;
64: }
65:
66: }
67:
68: 69: 70: 71: 72: 73:
74: class Whups_Test_Perms {
75:
76: function getPermissions($permission, $user = null, $creator = null)
77: {
78: return true;
79: }
80:
81: function exists($permission)
82: {
83: return true;
84: }
85:
86: function hasPermission($permission, $user, $perm, $creator = null)
87: {
88: return true;
89: }
90:
91: }
92:
93: