/** * Init this collection of GraphNode's. * * @param FacebookRequest $request The original request that generated this data. * @param array $data An array of GraphNode's. * @param array $metaData An array of Graph meta data like pagination, etc. * @param string|null $parentEdgeEndpoint The parent Graph edge endpoint that generated the list. * @param string|null $subclassName The subclass of the child GraphNode's. */ public function __construct(FacebookRequest $request, array $data = [], array $metaData = [], $parentEdgeEndpoint = null, $subclassName = null) { $this->request = $request; $this->metaData = $metaData; $this->parentEdgeEndpoint = $parentEdgeEndpoint; $this->subclassName = $subclassName; parent::__construct($data); }
public function testACollectionCanBeConvertedToProperJson() { $collection = new Collection(['foo', 'bar', 123]); $collectionAsString = $collection->asJson(); $this->assertEquals('["foo","bar",123]', $collectionAsString); }