public function testCanDynamicallyCreateObjects() { $object = Element::p('foo')->class('bar'); $matcher = $this->getMatcher(); $matcher['attributes']['class'] = 'bar'; $this->assertHTML($matcher, $object); }
public function testCanDynamicallyGetChild() { $two = Element::p('foo'); $one = Element::div()->setChild($two, 'two'); $zero = Element::div()->setChild($one, 'one'); $this->assertEquals('foo', $zero->oneTwo->getValue()); }
public function testCanNestMultipleElements() { $foo = Element::strong('foo'); $bar = Element::p('bar'); $this->object->nestChildren(array('foo' => $foo, 'bar' => $bar)); $this->assertEquals($foo, $this->object->getChild('foo')); $this->assertEquals($bar, $this->object->getChild('bar')); }