public function testCollect()
 {
     $toggle1 = new Toggle();
     $toggle2 = new Toggle();
     $label = new Label();
     $label->addScriptFeature($toggle2);
     $this->assertEmpty(ScriptFeature::collect(null));
     $this->assertEquals(array($toggle1), ScriptFeature::collect($toggle1));
     $this->assertEquals(array($toggle2), ScriptFeature::collect($label));
     $this->assertEquals(array($toggle1, $toggle2), ScriptFeature::collect($toggle1, $label));
 }
예제 #2
0
 /**
  * @see ScriptFeatureable::getScriptFeatures()
  */
 public function getScriptFeatures()
 {
     return ScriptFeature::collect($this->feature, $this->getLabel(), $this->feature->getEntry());
 }