Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Assert that SetNodeProperties is not handled empty #5396

Open
wants to merge 3 commits into
base: 9.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Feature: Set node properties: Constraint checks
| Key | Value |
| nodeAggregateId | "lady-eleonode-rootford" |
| originDimensionSpacePoint | {"language":"de"} |
| propertyValues | {} |
| propertyValues | {"text":"New text"} |
Then the last command should have thrown an exception of type "NodeAggregateIsRoot"

Scenario: Try to set properties in an origin dimension space point that does not exist
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ private function __construct(
public OriginDimensionSpacePoint $originDimensionSpacePoint,
public PropertyValuesToWrite $propertyValues,
) {
if ($this->propertyValues->isEmpty()) {
throw new \InvalidArgumentException(sprintf('The command "SetNodeProperties" for node %s must contain property values', $this->nodeAggregateId->value), 1733394351);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,9 @@ public function getPropertiesToUnset(): PropertyNames
)
);
}

public function isEmpty(): bool
{
return $this->values === [];
}
}
Loading