helper('html');
}
// ------------------------------------------------------------------------
public function test_heading()
{
$this->assertEquals('
foobar
', heading('foobar'));
$this->assertEquals('foobar
', heading('foobar', 2, 'class="bar"'));
}
public function test_heading_array_attributes()
{
// Test array of attributes
$this->assertEquals('foobar
', heading('foobar', 2, array('class' => 'bar', 'id' => 'foo')));
}
public function test_heading_object_attributes()
{
// Test array of attributes
$this->assertEquals('foobar
', heading('foobar', 2, array('class' => 'bar', 'id' => 'foo')));
$test = new stdClass;
$test->class = "bar";
$test->id = "foo";
$this->assertEquals('foobar
', heading('foobar', 2, $test));
}
// ------------------------------------------------------------------------
public function test_Ul()
{
$expect = <<
foo
bar
EOH;
$expect = ltrim($expect);
$list = array('foo', 'bar');
$this->assertEquals(ltrim($expect), ul($list));
$expect = <<
foo
bar
EOH;
$expect = ltrim($expect);
$this->assertEquals($expect, ul($list, 'class="test"'));
$this->assertEquals($expect, ul($list, array('class' => 'test')));
}
// ------------------------------------------------------------------------
public function test_meta()
{
$this->assertEquals(
"\n",
meta('test', 'foo')
);
$this->assertEquals(
"\n",
meta(array('name' => 'foo'))
);
$this->assertEquals(
"\n",
meta(array('name' => 'foo', 'type' => 'charset'))
);
$this->assertEquals(
"\n",
meta(array('name' => 'foo', 'type' => 'charset'))
);
}
}