getMockBuilder(\taoResultServer_models_classes_Variable::class)->disableOriginalConstructor()->getMock(); $var = new \oat\taoResultServer\models\Entity\ItemVariableStorable('deliveryResultIdentifier', 'test', $resultVariable, 'item', 'callIdItem'); $this->assertInstanceOf(\JsonSerializable::class, $var); $this->assertEquals([ "deliveryResultIdentifier" => 'deliveryResultIdentifier', "test" => 'test', "item" => 'item', "variable" => serialize($resultVariable), "callIdItem" => 'callIdItem', "callIdTest" => null, "uri" => 'deliveryResultIdentifiercallIdItem', "class" => get_class($resultVariable) ], $var->jsonSerialize()); } }