function it_merges_stacks(TaskStack $stack, Task $task4, Task $task5) { $task4->getDependencies()->willReturn(array()); $task5->getDependencies()->willReturn(array()); $task4->getName()->willReturn('task4'); $task5->getName()->willReturn('task5'); $stack->getIterator()->willReturn(new \ArrayIterator(array($task4->getWrappedObject(), $task5->getWrappedObject()))); $this->merge($stack); $this->has('task4')->shouldReturn(true); $this->has('task5')->shouldReturn(true); }