public function testPresentingArrayAsOl() { $presenter = new Presenter(); $array = ['foo', 'bar', 'baz' => ['bat', 'qux']]; $expected = '<ol><li>foo</li><li>bar</li><li>baz<ol><li>bat</li><li>qux</li></ol></li></ol>'; $this->assertEquals($expected, $presenter->presentArrayAsOl($array)); }
/** * Presents the children of the given node in the given * format. If the attribute provided is a closure, we will * call it, providing every single node recursively. You * must return a string from your closure which will be * used as the output for that node when presenting. * * @param string $format * @param string|Closure $attribute * @param int $depth * @return mixed */ public function presentChildrenAs($format, $attribute, $depth = 0) { return static::$presenter->presentChildrenAs($this, $format, $attribute, $depth); }