public function testCount()
 {
     $element = $this->getMock('\\StateMachine\\Collection\\CollectibleInterface');
     $element->expects($this->any())->method('getName')->willReturn('foo');
     $collection = new GenericCollection(['foo', 'bar']);
     $this->assertEquals(2, $collection->count());
 }
 public function getClass()
 {
     $collection = new GenericCollection();
     $collection->addItem(new \stdClass());
     $collection->addItem(new \stdClass());
     $collection->addItem(new \stdClass());
     return $collection;
 }
 /**
  * Create serializable data collection from the given array.
  * 
  * @param array $data the collection of properties
  *
  * @throws \InvalidArgumentException an invalid collection was given
  */
 public function __construct($data = array())
 {
     if (is_array($data)) {
         parent::__construct($data);
     } elseif ($data instanceof \Gishiki\Algorithms\Collections\CollectionInterface) {
         $this->data = $data->all();
     }
 }
Esempio n. 4
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct('GoogleMaps\\Result');
 }