Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #212 from gevans/3.3/feature/4412-empty-attributes…

…-test

Adds tests for HTML::attributes(), refs #4412
  • Loading branch information...
commit 363034985052298ab396563cd96f509ead332eff 2 parents 7ae7010 + 485acf4
@shadowhand shadowhand authored
Showing with 14 additions and 1 deletion.
  1. +14 −1 tests/kohana/HTMLTest.php
View
15 tests/kohana/HTMLTest.php
@@ -18,6 +18,7 @@ class Kohana_HTMLTest extends Unittest_TestCase
protected $environmentDefault = array(
'Kohana::$base_url' => '/kohana/',
'Kohana::$index_file' => 'index.php',
+ 'HTML::$strict' => TRUE,
'HTTP_HOST' => 'www.kohanaframework.org',
);
@@ -31,20 +32,29 @@ public function provider_attributes()
return array(
array(
array('name' => 'field', 'random' => 'not_quite', 'id' => 'unique_field'),
+ array(),
' id="unique_field" name="field" random="not_quite"'
),
array(
array('invalid' => NULL),
+ array(),
''
),
array(
array(),
+ array(),
''
),
array(
array('name' => 'field', 'checked'),
+ array(),
' name="field" checked="checked"',
),
+ array(
+ array('id' => 'disabled_field', 'disabled'),
+ array('HTML::$strict' => FALSE),
+ ' id="disabled_field" disabled',
+ ),
);
}
@@ -54,10 +64,13 @@ public function provider_attributes()
* @test
* @dataProvider provider_attributes
* @param array $attributes Attributes to use
+ * @param array $options Environment options to use
* @param string $expected Expected output
*/
- public function test_attributes($attributes, $expected)
+ public function test_attributes(array $attributes, array $options, $expected)
{
+ $this->setEnvironment($options);
+
$this->assertSame(
$expected,
HTML::attributes($attributes)
Please sign in to comment.
Something went wrong with that request. Please try again.