function it_prints_a_graph(Graph $graph, Link $link, Node $node, Node $anotherNode) { $graph->getDirection()->willReturn('LR'); $node->getId()->willReturn('A'); $node->getText()->willReturn('First node'); $node->getStyle()->willReturn(Node::SQUARE_EDGE); $node->getAttachedClasses()->willReturn([]); $anotherNode->getId()->willReturn('B'); $anotherNode->getText()->willReturn('Second node'); $anotherNode->getStyle()->willReturn(Node::ROUND_EDGE); $anotherNode->getAttachedClasses()->willReturn([]); $graph->getNodes()->willReturn([$node, $anotherNode]); $link->getNodes()->willReturn([$node, $anotherNode]); $link->isOpen()->willReturn(false); $link->getText()->willReturn('Text on link'); $graph->getLinks()->willReturn([$link]); $graph->getClasses()->willReturn([]); $this->printGraph($graph, true)->shouldReturn('<div class="mermaid">' . 'graph LR;A[First node];B(Second node);A-->|Text on link|B;' . '</div>'); }