Exemple #1
0
 /**
  * Get an iterator for the properties
  *
  * @see IteratorAggregate::getIterator()
  * @return ArrayIterator
  */
 public function getIterator()
 {
     if (isset($this->_fd[0]) && $this->_fd[0] instanceof DOMElement) {
         $properties = new FluentDOMCssProperties($this->_fd[0]->getAttribute('style'));
         return $properties->getIterator();
     }
     return new ArrayIterator(array());
 }
Exemple #2
0
 /**
  * @covers FluentDOMCssProperties::getIterator
  */
 public function testGetIterator()
 {
     $css = new FluentDOMCssProperties('width: auto; height: auto;');
     $this->assertEquals(array('width' => 'auto', 'height' => 'auto'), $css->getIterator()->getArrayCopy());
 }