Only confirmed sponsors are returned

This commit is contained in:
Oliver Davies 2019-05-20 22:40:38 +01:00
parent b23d170804
commit 21d1bc113c
2 changed files with 12 additions and 1 deletions

View file

@ -28,6 +28,7 @@ class SponsorsExtension extends AbstractExtension
}) })
->filter->isConfirmed() ->filter->isConfirmed()
->map->getData() ->map->getData()
->values()
->toArray(); ->toArray();
} }
} }

View file

@ -39,6 +39,16 @@ class SponsorsTest extends TestCase
/** @test */ /** @test */
public function only_confirmed_sponsors_are_returned() 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']);
} }
} }