Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/Types/AbstractCypherSequence.php
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ public function __serialize(): array
$this->preload();

$tbr = get_object_vars($this);
$tbr['generator'] = new ArrayIterator($this->cache);
$tbr['generator'] = new ArrayIterator();
$tbr['currentPosition'] = 0;
$tbr['generatorPosition'] = 0;

Expand Down
15 changes: 15 additions & 0 deletions tests/Unit/CypherListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ public function setUp(): void
$this->list = new CypherList(['A', 'B', 'C']);
}

// https://github.com/neo4j-php/neo4j-php-client/issues/220
public function testNoDoubleResultsAfterDeserialization(): void
{
$list = new CypherList(['A', 'B', 'C']);
$serialized = serialize($list);
$unserialized = unserialize($serialized);

$count = 0;
foreach ($unserialized as $item) {
++$count;
}

self::assertEquals(3, $count);
}

public function testFromIterableEqual(): void
{
$fromIterable = CypherList::fromIterable($this->list);
Expand Down
Loading