Files
html/tests/HtmlBuilderTest.php
T
Devin Dombrowski - Locutus 6e459dc808 Proposal: add a dl method to HtmlBuilder
Method generates a description list of items.
2015-02-18 13:57:38 -08:00

45 lines
948 B
PHP

<?php
use Illuminate\Session\Store;
use Mockery as m;
use Illuminate\Http\Request;
use Collective\Html\FormBuilder;
use Collective\Html\HtmlBuilder;
use Illuminate\Routing\UrlGenerator;
use Illuminate\Routing\RouteCollection;
class HtmlBuilderTest extends PHPUnit_Framework_TestCase {
/**
* Setup the test environment.
*/
public function setUp()
{
$this->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('<dl class="example"><dt>foo</dt><dd>bar</dd><dt>bing</dt><dd>baz</dd></dl>', $result);
}
}