Esempio n. 1
0
 /**
  * Get components.
  * @return mixed
  */
 public function getActiveComponents()
 {
     if ($this->_active_components == null) {
         if ($this->_active_components = Component::getComponents()) {
             return $this->_active_components;
         }
     }
     return $this->_active_components;
 }
Esempio n. 2
0
 function testGetComponents()
 {
     $comp = new Component('VCALENDAR');
     // Note that 'myProp' is ignored here.
     $comp->children = array(new Property('FOO', 'BAR'), new Component('VTODO'));
     $r = $comp->getComponents();
     $this->assertInternalType('array', $r);
     $this->assertEquals(1, count($r));
     $this->assertEquals('VTODO', $r[0]->name);
 }