Make unit tests working

This commit is contained in:
Eric Espie
2025-10-02 09:48:22 +02:00
parent 0ea0da525e
commit 39fd879ca9
83 changed files with 1924 additions and 262 deletions

View File

@@ -72,7 +72,6 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface
{
// Can be used as copy constructor
if ($propertyPath instanceof self) {
/* @var PropertyPath $propertyPath */
$this->elements = $propertyPath->elements;
$this->length = $propertyPath->length;
$this->isIndex = $propertyPath->isIndex;
@@ -122,7 +121,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface
}
if ('' !== $remaining) {
throw new InvalidPropertyPathException(sprintf('Could not parse property path "%s". Unexpected token "%s" at position %d.', $propertyPath, $remaining[0], $position));
throw new InvalidPropertyPathException(\sprintf('Could not parse property path "%s". Unexpected token "%s" at position %d.', $propertyPath, $remaining[0], $position));
}
$this->length = \count($this->elements);
@@ -171,7 +170,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface
public function getElement(int $index): string
{
if (!isset($this->elements[$index])) {
throw new OutOfBoundsException(sprintf('The index "%s" is not within the property path.', $index));
throw new OutOfBoundsException(\sprintf('The index "%s" is not within the property path.', $index));
}
return $this->elements[$index];
@@ -180,7 +179,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface
public function isProperty(int $index): bool
{
if (!isset($this->isIndex[$index])) {
throw new OutOfBoundsException(sprintf('The index "%s" is not within the property path.', $index));
throw new OutOfBoundsException(\sprintf('The index "%s" is not within the property path.', $index));
}
return !$this->isIndex[$index];
@@ -189,7 +188,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface
public function isIndex(int $index): bool
{
if (!isset($this->isIndex[$index])) {
throw new OutOfBoundsException(sprintf('The index "%s" is not within the property path.', $index));
throw new OutOfBoundsException(\sprintf('The index "%s" is not within the property path.', $index));
}
return $this->isIndex[$index];
@@ -198,7 +197,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface
public function isNullSafe(int $index): bool
{
if (!isset($this->isNullSafe[$index])) {
throw new OutOfBoundsException(sprintf('The index "%s" is not within the property path.', $index));
throw new OutOfBoundsException(\sprintf('The index "%s" is not within the property path.', $index));
}
return $this->isNullSafe[$index];