createCollection(); $this->assertInstanceOf(TaskLogCollection::class, $collection); } /** * @throws \Exception * @throws \common_exception_Error */ public function testCollectionToArray() { $collection = $this->createCollection(); $this->assertIsArray($collection->jsonSerialize()); } /** * @return TaskLogCollection * @throws \Exception * @throws \common_exception_Error */ protected function createCollection() { return TaskLogCollection::createFromArray([ [ 'id' => 'rdf#i1508337970199318643', 'parent_id' => 'parentFake0002525', 'task_name' => 'Task Name', 'label' => 'Task label', 'status' => TaskLogInterface::STATUS_COMPLETED, 'owner' => 'userId', 'parameters' => json_encode([]), 'created_at' => '2017-02-01 12:00:01', 'updated_at' => '2017-02-01 14:00:01', 'report' => [ 'type' => 'info', 'message' => 'Running task rdf#i1508337970199318643', 'data' => null, 'children' => [] ], ], [ 'id' => 'rdf#i15083379701993186432222', 'parent_id' => 'parentFake0002525', 'task_name' => 'Task Name 2', 'label' => 'Task label 2', 'status' => TaskLogInterface::STATUS_RUNNING, 'owner' => 'userId', 'parameters' => json_encode([]), 'created_at' => '2017-02-01 16:00:01', 'updated_at' => '2017-02-01 18:00:01', 'report' => [ 'type' => 'info', 'message' => 'Running task #i15083379701993186432222', 'data' => null, 'children' => [] ], ], [ 'id' => 'rdf#i150833797019931864322223', 'parent_id' => 'parentFake0002525', 'task_name' => 'Task Name 3', 'label' => 'Task label 3', 'status' => TaskLogInterface::STATUS_RUNNING, 'owner' => 'userId', 'parameters' => json_encode([]), 'created_at' => '2017-02-01 16:00:01', 'updated_at' => '2017-02-01 18:00:01', 'report' => [ 'type' => 'info', 'message' => 'Running task #i15083379701993186433333', 'data' => null, 'children' => [] ], ], ]); } }