Example #1
0
    public function testCanCreateAndAddHeaderBodyAndFooter()
    {

        $modal = Modal::create("bar", $this->getAttributes())->footer("Foo bar")->body("Foo bar")->header("Foo bar");

        $matcher = array(
            'tag' => 'div',
            'attributes' => array(
                'class' => 'modal-body'
            ),
            'content' => 'Foo bar'
        );
        $parent = $this->getMatcher();
        $parent['descendant'] = array(
            'tag' => 'div',
            'attributes' => array(
                'class' => 'modal-footer'
            ),
            'content' => "Foo bar",
        );
        $parent['child']['descendant'] =
            array(
                'tag' => "h3",
                'attributes' => array(),
                'content' => 'Foo bar'
            );
        $matcher['parent']['parent']['parent'] = $parent;

        $this->assertHTML($matcher, $modal);

    }
Example #2
0
 /**
  * Adds the given classes to attributes
  *
  * @param array $classes
  * @return $this 
  * @static 
  */
 public static function addClass($classes)
 {
     //Method inherited from \Bootstrapper\RenderedObject
     return \Bootstrapper\Modal::addClass($classes);
 }