/** * @covers hypeJunction\Inbox\Group::add * @covers hypeJunction\Inbox\Group::entities * @covers hypeJunction\Inbox\Group::toEntity */ public function testEntities() { $mock = $this->getMock('\\ElggEntity'); $mock->expects($this->once())->method('getGUID')->willReturn(4); $entities = $this->object->add('foo')->add(array('bar', new stdClass()))->add(0)->add(1)->add(array(2, 3))->add($mock)->entities(); $this->assertInternalType('array', $entities); foreach ($entities as $entity) { $this->assertInstanceOf('\\ElggEntity', $entity); } }
/** * Create a new group from a mixed data set * * @param array $data Data set * @return Group */ public static function create($data) { $group = new Group(); return $group->add($data); }