Skip to content

Commit 8658683

Browse files
authored
Merge pull request #1355 from reminec/2.0
[Hydra]Functional tests for denormalization issue. #1353
2 parents 3f2f9da + 63454cc commit 8658683

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

features/bootstrap/HydraContext.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,18 @@ public function assertPropertyIsRequired($propertyName, $className)
178178
}
179179
}
180180

181+
/**
182+
* @Then ":prop" property is not required for Hydra class ":class"
183+
*/
184+
public function assertPropertyIsNotRequired($propertyName, $className)
185+
{
186+
$properties = $this->getProperty($propertyName, $className);
187+
188+
if (!empty($properties->{'hydra:required'})) {
189+
throw new \Exception(sprintf('Property "%s" of class "%s" is not required', $propertyName, $className));
190+
}
191+
}
192+
181193
/**
182194
* @param string $propertyName
183195
* @param string $className

features/hydra/docs.feature

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ Feature: Documentation support
5959
And "name" property is readable for Hydra class "Dummy"
6060
And "name" property is writable for Hydra class "Dummy"
6161
And "name" property is required for Hydra class "Dummy"
62+
And "plainPassword" property is not readable for Hydra class "User"
63+
And "plainPassword" property is writable for Hydra class "User"
64+
And "plainPassword" property is not required for Hydra class "User"
6265
And the value of the node "@type" of the property "name" of the Hydra class "Dummy" is "hydra:SupportedProperty"
6366
And the value of the node "hydra:property.@id" of the property "name" of the Hydra class "Dummy" is "http://schema.org/name"
6467
And the value of the node "hydra:property.@type" of the property "name" of the Hydra class "Dummy" is "rdf:Property"

0 commit comments

Comments
 (0)