diff --git a/src/Sponsors/src/TwigExtension/SponsorsExtension.php b/src/Sponsors/src/TwigExtension/SponsorsExtension.php index 0769a07..966e1c4 100644 --- a/src/Sponsors/src/TwigExtension/SponsorsExtension.php +++ b/src/Sponsors/src/TwigExtension/SponsorsExtension.php @@ -28,6 +28,7 @@ class SponsorsExtension extends AbstractExtension }) ->filter->isConfirmed() ->map->getData() + ->values() ->toArray(); } } diff --git a/src/Sponsors/tests/SponsorsTest.php b/src/Sponsors/tests/SponsorsTest.php index bed0c7a..cd108bd 100644 --- a/src/Sponsors/tests/SponsorsTest.php +++ b/src/Sponsors/tests/SponsorsTest.php @@ -39,6 +39,16 @@ class SponsorsTest extends TestCase /** @test */ public function only_confirmed_sponsors_are_returned() { - $this->markTestIncomplete(); + $data = [ + Sponsor::LEVEL_GOLD => [ + ['name' => 'Acquia', 'confirmed' => false], + ['name' => 'Microserve', 'confirmed' => true], + ], + ]; + + $sponsors = $this->extension->getSponsors($data, Sponsor::LEVEL_GOLD); + + $this->assertCount(1, $sponsors); + $this->assertSame('Microserve', $sponsors[0]['name']); } }