From d9be52579d79f38be861260d1e3f03923ee14447 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Thu, 11 Aug 2022 15:10:07 +1200 Subject: [PATCH] MNT Fix test --- tests/php/ORM/ListDecoratorTest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/php/ORM/ListDecoratorTest.php b/tests/php/ORM/ListDecoratorTest.php index 2e85f50c9..0410bba76 100644 --- a/tests/php/ORM/ListDecoratorTest.php +++ b/tests/php/ORM/ListDecoratorTest.php @@ -2,6 +2,7 @@ namespace SilverStripe\ORM\Tests; +use ArrayIterator; use LogicException; use PHPUnit\Framework\MockObject\MockObject; use SilverStripe\Dev\SapphireTest; @@ -34,8 +35,9 @@ class ListDecoratorTest extends SapphireTest public function testGetIterator() { - $this->list->expects($this->once())->method('getIterator')->willReturn('mock'); - $this->assertSame('mock', $this->decorator->getIterator()); + $iterator = new ArrayIterator(); + $this->list->expects($this->once())->method('getIterator')->willReturn($iterator); + $this->assertSame($iterator, $this->decorator->getIterator()); } public function testCanSortBy()