diff --git a/Definition/DataDefinition.php b/Definition/DataDefinition.php index 44dcc38..e7b0126 100644 --- a/Definition/DataDefinition.php +++ b/Definition/DataDefinition.php @@ -205,7 +205,7 @@ public function setVariants(array $variants): self { foreach ($variants as $variant_name => $variant) { $properties = $variant->getProperties(); foreach ($properties as $name => $property) { - $property->setMachineName($name); + $property->setName($name); } } @@ -283,7 +283,7 @@ public function setProperties(array $properties): self { // Fill in machine names as a convenience. foreach ($this->properties as $name => $property) { - $property->setMachineName($name); + $property->setName($name); } return $this; @@ -412,7 +412,7 @@ public function addProperties(array $properties): self { foreach ($properties as $name => $property) { // Fill in machine names as a convenience. - $property->setMachineName($name); + $property->setName($name); // Explicitly unset an existing property, so that the incoming order is // used. diff --git a/Definition/VariantDefinition.php b/Definition/VariantDefinition.php index d1e97d5..8f51b71 100644 --- a/Definition/VariantDefinition.php +++ b/Definition/VariantDefinition.php @@ -40,7 +40,7 @@ public function setProperties(array $properties) { // Fill in machine names as a convenience. foreach ($this->properties as $name => $property) { - $property->setMachineName($name); + $property->setName($name); } return $this; @@ -49,7 +49,7 @@ public function setProperties(array $properties) { public function addProperties(array $properties): self { foreach ($properties as $name => $property) { // Fill in machine names as a convenience. - $property->setMachineName($name); + $property->setName($name); $this->properties[$name] = $property; } diff --git a/Test/src/DataItemTest.php b/Test/src/DataItemTest.php index 8796d20..ae71590 100644 --- a/Test/src/DataItemTest.php +++ b/Test/src/DataItemTest.php @@ -100,7 +100,7 @@ public function testDataItemFactory() { public function testGetParent() { $complex_data = DataItemFactory::createFromDefinition( DataDefinition::create('complex') - ->setMachineName('root') + ->setName('root') ->setProperties([ 'one' => DataDefinition::create('complex') ->setMultiple(TRUE) @@ -175,7 +175,7 @@ public function testItemAddress() { // Data item with a root machine name. $complex_data = DataItemFactory::createFromDefinition( DataDefinition::create('complex') - ->setMachineName('root') + ->setName('root') ->setLabel('Root') ->setRequired(TRUE) ->setProperties([ @@ -416,7 +416,7 @@ public function testBubbling() { */ public function testDefaults() { $definition = DataDefinition::create('complex') - ->setMachineName('complex_data') + ->setName('complex_data') ->setProperties([ 'scalar_no_default' => DataDefinition::create('string'), 'scalar_default' => DataDefinition::create('string') @@ -628,7 +628,7 @@ public function testOverridingDefaults() { public function testDefaultExpressionAddressConversion() { $complex_data = DataItemFactory::createFromDefinition( DataDefinition::create('complex') - ->setMachineName('root') + ->setName('root') ->setProperties([ 'one' => DataDefinition::create('complex') ->setMultiple(TRUE) @@ -878,7 +878,7 @@ public function testValidators() { $factory_class = \MutableTypedData\Fixtures\Factory\FactoryWithValidators::class; $definition = DataDefinition::create('string') - ->setMachineName('root') + ->setName('root') ->setLabel('Colour string') ->setValidators('colour'); @@ -945,7 +945,7 @@ public function testUnset() { */ public function testImportExport() { $definition = DataDefinition::create('complex') - ->setMachineName('root') + ->setName('root') ->setLabel('Label') ->setRequired(TRUE) ->setProperties([ @@ -1116,7 +1116,7 @@ public function testImportWithDefinitionUpdate() { */ public function testWalk() { $definition = DataDefinition::create('complex') - ->setMachineName('root') + ->setName('root') ->setLabel('Label') ->setRequired(TRUE) ->setProperties([ diff --git a/Test/src/PropertyDefinitionTest.php b/Test/src/PropertyDefinitionTest.php index 1b268c5..06cda6b 100644 --- a/Test/src/PropertyDefinitionTest.php +++ b/Test/src/PropertyDefinitionTest.php @@ -98,7 +98,7 @@ public function testDefineChildProperties() { $this->assertEquals(['alpha', 'beta'], array_keys($definition->getProperties())); $definition->addProperty(DataDefinition::create('string') - ->setMachineName('gamma') + ->setName('gamma') ->setLabel('Label') ->setRequired(TRUE) );