@@ 207-230 (lines=24) @@ | ||
204 | } |
|
205 | ||
206 | // T F - |
|
207 | function it_creates_two_different_class_definitions_for_the_same_class_with_different_interfaces_and_without_patches( |
|
208 | ClassMirror $mirror, |
|
209 | ClassCreator $creator, |
|
210 | NameGenerator $namer, |
|
211 | \ReflectionClass $class, |
|
212 | \ReflectionClass $interface1, |
|
213 | \ReflectionClass $interface2, |
|
214 | ClassNode $node1, |
|
215 | ClassNode $node2 |
|
216 | ) { |
|
217 | $mirror->reflect($class, array($interface1))->willReturn($node1); |
|
218 | $mirror->reflect($class, array($interface2))->willReturn($node2); |
|
219 | $namer->name($class, array($interface1))->willReturn('SplStack'); |
|
220 | $namer->name($class, array($interface2))->willReturn('SplStack'); |
|
221 | $class->getName()->willReturn('stdClass'); |
|
222 | $interface1->getName()->willReturn('ArrayAccess'); |
|
223 | $interface2->getName()->willReturn('Iterator'); |
|
224 | ||
225 | $creator->create('SplStack', $node1)->shouldBeCalledTimes(1); |
|
226 | $creator->create('SplStack', $node2)->shouldBeCalledTimes(1); |
|
227 | ||
228 | $this->double($class, array($interface1)); |
|
229 | $this->double($class, array($interface2)); |
|
230 | } |
|
231 | ||
232 | // F F - |
|
233 | function it_creates_two_different_class_definitions_for_different_classes_with_different_interfaces_and_without_patches( |
|
@@ 233-258 (lines=26) @@ | ||
230 | } |
|
231 | ||
232 | // F F - |
|
233 | function it_creates_two_different_class_definitions_for_different_classes_with_different_interfaces_and_without_patches( |
|
234 | ClassMirror $mirror, |
|
235 | ClassCreator $creator, |
|
236 | NameGenerator $namer, |
|
237 | \ReflectionClass $class1, |
|
238 | \ReflectionClass $class2, |
|
239 | \ReflectionClass $interface1, |
|
240 | \ReflectionClass $interface2, |
|
241 | ClassNode $node1, |
|
242 | ClassNode $node2 |
|
243 | ) { |
|
244 | $mirror->reflect($class1, array($interface1))->willReturn($node1); |
|
245 | $mirror->reflect($class2, array($interface2))->willReturn($node2); |
|
246 | $namer->name($class1, array($interface1))->willReturn('SplStack'); |
|
247 | $namer->name($class2, array($interface2))->willReturn('spec\Prophecy\Doubler\aClass'); |
|
248 | $class1->getName()->willReturn('stdClass'); |
|
249 | $class2->getName()->willReturn('aClass'); |
|
250 | $interface1->getName()->willReturn('ArrayAccess'); |
|
251 | $interface2->getName()->willReturn('Iterator'); |
|
252 | ||
253 | $creator->create('SplStack', $node1)->shouldBeCalledTimes(1); |
|
254 | $creator->create('spec\Prophecy\Doubler\aClass', $node2)->shouldBeCalledTimes(1); |
|
255 | ||
256 | $this->double($class1, array($interface1)); |
|
257 | $this->double($class2, array($interface2)); |
|
258 | } |
|
259 | ||
260 | // T T T |
|
261 | function it_creates_only_one_class_definition_for_the_same_class_with_same_interfaces_and_same_patches( |