fce57cf7ba180bf8bfbadc2a94562bfcf0c2f871
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Tests / Unit / Object / Container / Fixtures / Testclasses.php
1 <?php
2
3 /**
4 * a singleton class
5 *
6 */
7 class t3lib_object_tests_singleton implements t3lib_Singleton {
8
9 }
10
11 /**
12 * test class A that depends on B and C
13 *
14 */
15 class t3lib_object_tests_a {
16 public $b;
17 public $c;
18
19 public function __construct( t3lib_object_tests_c $c, t3lib_object_tests_b $b) {
20 $this->b = $b;
21 $this->c = $c;
22 }
23 }
24 /**
25 * test class A that depends on B and C and has a third default parameter in constructor
26 *
27 */
28 class t3lib_object_tests_amixed_array {
29 public $b;
30 public $c;
31 public $myvalue;
32 public function __construct(t3lib_object_tests_b $b, t3lib_object_tests_c $c, array $myvalue=array('some' => 'default')) {
33 $this->b = $b;
34 $this->c = $c;
35 $this->myvalue = $myvalue;
36 }
37 }
38
39 /**
40 * test class A that depends on B and C and has a third default parameter in constructor
41 *
42 */
43 class t3lib_object_tests_amixed_array_singleton implements t3lib_Singleton {
44 public $b;
45 public $c;
46 public $myvalue;
47 public function __construct(t3lib_object_tests_b $b, t3lib_object_tests_c $c, array $myvalue=array('some' => 'default')) {
48 $this->b = $b;
49 $this->c = $c;
50 $this->myvalue = $myvalue;
51 }
52 }
53
54 /**
55 * test class B that depends on C
56 *
57 */
58 class t3lib_object_tests_b implements t3lib_Singleton {
59 public $c;
60 public function __construct(t3lib_object_tests_c $c) {
61 $this->c = $c;
62 }
63 }
64
65
66 /**
67 * test class C without dependencys
68 *
69 */
70 class t3lib_object_tests_c implements t3lib_Singleton {
71
72 }
73
74 /**
75 * test class B-Child that extends Class B (therfore depends also on Class C)
76 *
77 */
78 class t3lib_object_tests_b_child extends t3lib_object_tests_b {
79 }
80
81 interface t3lib_object_tests_someinterface {
82
83 }
84
85 /**
86 * class which implements a Interface
87 *
88 */
89 class t3lib_object_tests_someimplementation implements t3lib_object_tests_someinterface, t3lib_Singleton {
90 }
91
92 /**
93 * test class B-Child that extends Class B (therfore depends also on Class C)
94 *
95 */
96 class t3lib_object_tests_b_child_someimplementation extends t3lib_object_tests_b implements t3lib_object_tests_someinterface {
97 }
98
99 /**
100 * class which depends on a Interface
101 *
102 */
103 class t3lib_object_tests_needsinterface {
104 public function __construct(t3lib_object_tests_someinterface $i) {
105
106 }
107 }
108
109 /**
110 * classes that depends on each other (death look)
111 *
112 */
113 class t3lib_object_tests_cyclic1 {
114 public function __construct(t3lib_object_tests_cyclic2 $c) {
115
116 }
117 }
118
119 class t3lib_object_tests_cyclic2 {
120 public function __construct(t3lib_object_tests_cyclic1 $c) {
121
122 }
123 }
124
125 /**
126 * class which has setter injections defined
127 *
128 */
129 class t3lib_object_tests_injectmethods {
130 public $b;
131 public $bchild;
132
133 public function injectClassB(t3lib_object_tests_b $o) {
134 $this->b = $o;
135 }
136
137 /**
138 * @inject
139 * @param t3lib_object_tests_b $o
140 */
141 public function setClassBChild(t3lib_object_tests_b_child $o) {
142 $this->bchild = $o;
143 }
144 }
145
146 /**
147 * class which needs extenson settings injected
148 *
149 */
150 class t3lib_object_tests_injectsettings {
151 public $settings;
152 public function injectExtensionSettings(array $settings) {
153 $this->settings = $settings;
154 }
155 }
156
157 /**
158 *
159 *
160 */
161 class t3lib_object_tests_resolveablecyclic1 implements t3lib_Singleton {
162 public $o2;
163 public function __construct(t3lib_object_tests_resolveablecyclic2 $cyclic2) {
164 $this->o2 = $cyclic2;
165 }
166 }
167
168 /**
169 *
170 *
171 */
172 class t3lib_object_tests_resolveablecyclic2 implements t3lib_Singleton {
173 public $o1;
174 public $o3;
175 public function injectCyclic1(t3lib_object_tests_resolveablecyclic1 $cyclic1) {
176 $this->o1 = $cyclic1;
177 }
178 public function injectCyclic3(t3lib_object_tests_resolveablecyclic3 $cyclic3) {
179 $this->o3 = $cyclic3;
180 }
181 }
182
183 /**
184 *
185 *
186 */
187 class t3lib_object_tests_resolveablecyclic3 implements t3lib_Singleton {
188 public $o1;
189 public function injectCyclic1(t3lib_object_tests_resolveablecyclic1 $cyclic1) {
190 $this->o1 = $cyclic1;
191 }
192 }
193
194