'rdf#i1508337970199318643', 'parent_id' => 'parentFake0002525', 'task_name' => 'Task Name', 'parameters' => json_encode(['param1' => 'value1', 'param2' => 'value2']), 'label' => 'Task label', 'status' => TaskLogInterface::STATUS_COMPLETED, 'owner' => 'userId', 'created_at' => $createdAt->format('Y-m-d H:i:s'), 'updated_at' => $updatedAt->format('Y-m-d H:i:s'), 'report' => [ 'type' => 'info', 'message' => 'Running task http://www.taoinstance.dev/ontologies/tao.rdf#i1508337970199318643', 'data' => null, 'children' => [] ], 'master_status' => true ], DateTime::RFC3339); $this->assertInstanceOf(TaskLogEntity::class, $entity); $this->assertInstanceOf(CategorizedStatus::class, $entity->getStatus()); $this->assertInstanceOf(Report::class, $entity->getReport()); $this->assertIsString($entity->getId()); $this->assertIsString($entity->getTaskName()); $this->assertIsArray($entity->getParameters()); $this->assertIsString($entity->getLabel()); $this->assertIsString($entity->getOwner()); $this->assertEquals([ 'id' => 'rdf#i1508337970199318643', 'taskName' => 'Task Name', 'taskLabel' => 'Task label', 'status' => 'completed', 'statusLabel' => 'Completed', 'report' => [ 'type' => 'info', 'message' => 'Running task http://www.taoinstance.dev/ontologies/tao.rdf#i1508337970199318643', 'data' => null, 'children' => [] ], 'masterStatus' => true ], $entity->jsonSerialize()); } public function testCreateWithReportNull() { $entity = TaskLogEntity::createFromArray([ 'id' => 'rdf#i1508337970199318643', 'parent_id' => 'parentFake0002525', 'task_name' => 'Task Name', 'parameters' => json_encode(['param1' => 'value1', 'param2' => 'value2']), 'label' => 'Task label', 'status' => TaskLogInterface::STATUS_COMPLETED, 'owner' => 'userId', 'created_at' => '2017-02-01 12:00:01', 'updated_at' => '2017-02-01 14:00:01', 'report' => [], ], DateTime::RFC3339); $this->assertNull($entity->getReport()); } }