function it_renders_closure_with_container_without_arguments(ExporterInterface $export, StatementInterface $body, ContainerInterface $container) { $body->compile($export)->willReturn('return $argument1'); $container->getIterator()->willReturn(new \ArrayIterator([$body->getWrappedObject()])); $this->beConstructedWith([], $container); $this->compile($export)->shouldReturn("function () {\n return \$argument1;\n}"); }
/** * Adds a new statement into body of closure * * @param StatementInterface $statement * * @return $this */ public function add(StatementInterface $statement) { $this->body->add($statement); return $this; }