public function it_should_generate_readable_documentation(MetadataExtractor $metadataExtractor, \Twig_Environment $twig) { $methodCollection = new MethodCollection(); $metadataExtractor->extract($methodCollection)->willReturn(['some_data' => 'about_methods']); $twig->render('path_to_template.html.twig', ['metadata' => ['some_data' => 'about_methods']])->willReturn('some_data about_methods'); $this->generate($methodCollection, 'path_to_template.html.twig')->shouldBeLike('some_data about_methods'); }
/** * @param MethodCollection $methodCollection * @param string $templateName * * @return string */ public function generate(MethodCollection $methodCollection, $templateName = 'default.html.twig') { $metadata = $this->metadataExtractor->extract($methodCollection); return $this->twig->render($templateName, ['metadata' => $metadata]); }