Esempio n. 1
0
 public function testSetOptionsType()
 {
     //do not provide the options type as the constructor argument
     $options = new Container();
     $options->setOptionsType('optionsType');
     $this->assertSame('optionsType', $options->getOptionsType());
 }
Esempio n. 2
0
 /**
  * The options to use when rendering this chart
  * @param  Container|ExtendedContainer $options stocked instance of chart options
  * @return Chart                       $this Current instance
  * @throws \InvalidArgumentException   if wrong instance type passed in
  */
 public function addOptions($options)
 {
     if ($options instanceof Container) {
         $this->_options[$options->getOptionsType()] = $options;
     } elseif ($options instanceof ExtendedContainer) {
         $this->_extendedOptions = $options;
     } elseif (is_array($options)) {
         foreach ($options as $option) {
             $this->addOptions($option);
         }
     } else {
         throw new \InvalidArgumentException("Options must be instance of Container or ExtendedContainer", 1);
     }
     return $this;
 }