Ejemplo n.º 1
0
 public function testCanDynamicallyCreateObjects()
 {
     $object = Element::p('foo')->class('bar');
     $matcher = $this->getMatcher();
     $matcher['attributes']['class'] = 'bar';
     $this->assertHTML($matcher, $object);
 }
Ejemplo n.º 2
0
 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());
 }
Ejemplo n.º 3
0
 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'));
 }