urlGenerator = new UrlGenerator(new RouteCollection(), Request::create('/foo', 'GET'));
$this->htmlBuilder = new HtmlBuilder($this->urlGenerator);
}
/**
* Destroy the test environment.
*/
public function tearDown()
{
m::close();
}
public function testDl()
{
$list = [
'foo' => 'bar',
'bing' => 'baz',
];
$attributes = ['class' => 'example'];
$result = $this->htmlBuilder->dl($list, $attributes);
$this->assertEquals('
- foo
- bar
- bing
- baz
', $result);
}
public function testMeta()
{
$result = $this->htmlBuilder->meta('description', 'Lorem ipsum dolor sit amet.');
$this->assertEquals(''.PHP_EOL, $result);
}
public function testMetaOpenGraph()
{
$result = $this->htmlBuilder->meta(null, 'website', ['property' => 'og:type']);
$this->assertEquals(''.PHP_EOL, $result);
}
public function testFavicon()
{
$this->urlGenerator->forceRootUrl('http://foo.com');
$target = $this->urlGenerator->to('bar.ico');
$result = $this->htmlBuilder->favicon('http://foo.com/bar.ico');
$this->assertEquals(''.PHP_EOL, $result);
}
}