Esempio n. 1
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\Panel::addClass($classes);
 }
Esempio n. 2
0
    public function testWeCanCallThemInSequence()
    {
        $methods = array(
            "header" => "Foo",
            "body" => "Bar",
            "footer" => "Baz"
        );
        foreach ($methods as $firstMethod => $firstParam) {
            foreach ($methods as $secondMethod => $secondParam) {
                if ($secondMethod != $firstMethod) {
                    foreach ($methods as $thirdMethod => $thirdParam) {
                        if ($thirdMethod != $firstMethod &&
                            $thirdMethod != $secondMethod
                        ) {

                            $panel = Panel::normal($this->testAttributes)
                                ->$firstMethod(
                                    $firstParam
                                )
                                ->$secondMethod(
                                    $secondParam
                                )
                                ->$thirdMethod(
                                    $thirdParam
                                );

                            $parent = $this->getMatcher("normal");
                            $parent['child'] = $this->getCorrectMatcher($secondMethod);
                            $parent['descendant'] = $this->getCorrectMatcher($thirdMethod);
                            $matcher = $this->getCorrectMatcher($firstMethod);
                            $matcher['parent'] = $parent;

                            $this->assertHtml($matcher, $panel);
                        }
                    }
                    $panel = Panel::normal($this->testAttributes)
                        ->$firstMethod(
                            $firstParam
                        )
                        ->$secondMethod(
                            $secondParam
                        );

                    $matcher = $this->getMatcher("normal");
                    $matcher['child'] = $this->getCorrectMatcher($firstMethod);
                    $matcher['descendant'] = $this->getCorrectMatcher($secondMethod);

                    $this->assertHtml($matcher, $panel);
                }
            }
            $panel = Panel::normal($this->testAttributes)
                ->$firstMethod(
                    $firstParam
                );

            $matcher = $this->getMatcher("normal");
            $matcher['child'] = $this->getCorrectMatcher($firstMethod);

            $this->assertHtml($matcher, $panel);
        }
    }