コード例 #1
0
 public function testCanDynamicallyCreateObjects()
 {
     $object = Element::p('foo')->class('bar');
     $matcher = $this->getMatcher();
     $matcher['attributes']['class'] = 'bar';
     $this->assertHTML($matcher, $object);
 }
コード例 #2
0
ファイル: TagTest.php プロジェクト: Geekathon/reddit-clone
 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());
 }
コード例 #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'));
 }