When this is enabled, properties that are disallowed will be skipped
instead of triggering an error during mapping.
public skipUnknownProperties ( ) : |
||
return | this |
/** * @test */ public function unknownNodePropertiesAreSkippedIfTypeConverterIsConfiguredLikeThis() { $this->setupNodeWithShadowNodeInPersonalWorkspace(); $input = array('__contextNodePath' => '/headline@' . $this->currentTestWorkspaceName, 'title' => 'New title', 'non-existing-input' => 'test'); $propertyMappingConfiguration = new PropertyMappingConfiguration(); $propertyMappingConfiguration->skipUnknownProperties(); $headlineNode = $this->convert($input, $propertyMappingConfiguration); $this->assertSame('New title', $headlineNode->getProperty('title')); $this->assertSame('Brave new world', $headlineNode->getProperty('subtitle')); $this->assertFalse($headlineNode->hasProperty('non-existing-input')); }