getMockBuilder(taoResultServer_models_classes_Variable::class)->disableOriginalConstructor()->getMock(), $this->getMockBuilder(taoResultServer_models_classes_Variable::class)->disableOriginalConstructor()->getMock(), ]; $testCollection = VariableStorableCollection::createTestVariableCollection('callIdTest', 'deliveryResultIdentifier', 'testIdentifier', $testVariables); $itemCollection = VariableStorableCollection::createItemVariableCollection('callIdItem', 'item', 'deliveryResultIdentifier', 'testIdentifier', $testVariables); $this->assertInstanceOf(VariableStorableCollection::class, $testCollection); $this->assertInstanceOf(\oat\taoResultServer\models\Collection\VariableStorableCollection::class, $itemCollection); } public function testTestsCollection() { $resultVariable1 = $this->getMockBuilder(taoResultServer_models_classes_OutcomeVariable::class)->disableOriginalConstructor()->getMock(); $resultVariable1 ->method('getIdentifier') ->willReturn('variable1'); $resultVariable2 = $this->getMockBuilder(taoResultServer_models_classes_OutcomeVariable::class)->disableOriginalConstructor()->getMock(); $resultVariable2 ->method('getIdentifier') ->willReturn('variable2'); $testVariables = [ $resultVariable1, $resultVariable2 ]; $collection = VariableStorableCollection::createTestVariableCollection('callIdTest', 'deliveryResultIdentifier', 'testIdentifier', $testVariables); $this->assertInstanceOf(VariableStorableCollection::class, $collection); $array = $collection->toStorableArray(); $this->assertArrayHasKey('variable1', $array); $this->assertArrayHasKey('variable2', $array); $this->assertIsString($array['variable1']); $this->assertIsString($array['variable2']); $this->assertSame('callIdTest', $collection->getIdentifier()); } public function testItemsCollection() { $resultVariable1 = $this->getMockBuilder(taoResultServer_models_classes_Variable::class)->disableOriginalConstructor()->getMock(); $resultVariable1 ->method('getIdentifier') ->willReturn('variable1'); $resultVariable2 = $this->getMockBuilder(taoResultServer_models_classes_Variable::class)->disableOriginalConstructor()->getMock(); $resultVariable2 ->method('getIdentifier') ->willReturn('variable2'); $testVariables = [ $resultVariable1, $resultVariable2 ]; $collection = VariableStorableCollection::createItemVariableCollection('callIdItem', 'item', 'deliveryResultIdentifier', 'testIdentifier', $testVariables); $this->assertInstanceOf(VariableStorableCollection::class, $collection); $array = $collection->toStorableArray(); $this->assertArrayHasKey('variable1', $array); $this->assertArrayHasKey('variable2', $array); $this->assertIsString($array['variable1']); $this->assertIsString($array['variable2']); $this->assertSame('callIdItem', $collection->getIdentifier()); } }