Applied fixes from StyleCI
This commit is contained in:
1 parent
8b7c357e78
commit
017d60144f
8 files changed
+1157
-1172
No files matched your search
+41
-44
@@ -1,59 +1,57 @@
|
||||
<?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\Http\Request;
|
||||
use Illuminate\Routing\RouteCollection;
|
||||
use Illuminate\Routing\UrlGenerator;
|
||||
use Mockery as m;
|
||||
|
||||
class HtmlBuilderTest extends PHPUnit_Framework_TestCase {
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy the test environment.
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
m::close();
|
||||
}
|
||||
public function testDl()
|
||||
{
|
||||
$list = [
|
||||
'foo' => 'bar',
|
||||
'bing' => 'baz',
|
||||
];
|
||||
|
||||
public function testDl()
|
||||
{
|
||||
$list = [
|
||||
'foo' => 'bar',
|
||||
'bing' => 'baz'
|
||||
];
|
||||
$attributes = ['class' => 'example'];
|
||||
|
||||
$attributes = ['class' => 'example'];
|
||||
$result = $this->htmlBuilder->dl($list, $attributes);
|
||||
|
||||
$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);
|
||||
}
|
||||
|
||||
$this->assertEquals('<dl class="example"><dt>foo</dt><dd>bar</dd><dt>bing</dt><dd>baz</dd></dl>', $result);
|
||||
}
|
||||
public function testMeta()
|
||||
{
|
||||
$result = $this->htmlBuilder->meta('description', 'Lorem ipsum dolor sit amet.');
|
||||
|
||||
public function testMeta()
|
||||
{
|
||||
$result = $this->htmlBuilder->meta('description', 'Lorem ipsum dolor sit amet.');
|
||||
$this->assertEquals('<meta name="description" content="Lorem ipsum dolor sit amet.">'.PHP_EOL, $result);
|
||||
}
|
||||
|
||||
$this->assertEquals('<meta name="description" content="Lorem ipsum dolor sit amet.">'.PHP_EOL, $result);
|
||||
}
|
||||
public function testMetaOpenGraph()
|
||||
{
|
||||
$result = $this->htmlBuilder->meta(null, 'website', ['property' => 'og:type']);
|
||||
|
||||
public function testMetaOpenGraph()
|
||||
{
|
||||
$result = $this->htmlBuilder->meta(null, 'website', ['property' => 'og:type']);
|
||||
|
||||
$this->assertEquals('<meta content="website" property="og:type">'.PHP_EOL, $result);
|
||||
}
|
||||
$this->assertEquals('<meta content="website" property="og:type">'.PHP_EOL, $result);
|
||||
}
|
||||
|
||||
public function testFavicon()
|
||||
{
|
||||
@@ -61,7 +59,6 @@ class HtmlBuilderTest extends PHPUnit_Framework_TestCase {
|
||||
$target = $this->urlGenerator->to('bar.ico');
|
||||
$result = $this->htmlBuilder->favicon('http://foo.com/bar.ico');
|
||||
|
||||
$this->assertEquals('<link rel="shortcut icon" type="image/x-icon" href="'.$target.'">' . PHP_EOL, $result);
|
||||
$this->assertEquals('<link rel="shortcut icon" type="image/x-icon" href="'.$target.'">'.PHP_EOL, $result);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user