Get sponsors by level
This commit is contained in:
parent
299bb34988
commit
b23d170804
|
@ -4,6 +4,10 @@ namespace App\Sponsors\Model;
|
|||
|
||||
class Sponsor
|
||||
{
|
||||
const LEVEL_GOLD = 'gold';
|
||||
const LEVEL_SILVER = 'silver';
|
||||
const LEVEL_BRONZE = 'bronze';
|
||||
|
||||
/** @var array */
|
||||
private $data = [];
|
||||
|
||||
|
|
|
@ -2,14 +2,38 @@
|
|||
|
||||
namespace App\Tests\Sponsors;
|
||||
|
||||
use App\Sponsors\Model\Sponsor;
|
||||
use App\Sponsors\TwigExtension\SponsorsExtension;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class SponsorsTest extends TestCase
|
||||
{
|
||||
/** @var SponsorsExtension */
|
||||
private $extension;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->extension = new SponsorsExtension();
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function get_sponsors_by_level()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
$data = [
|
||||
Sponsor::LEVEL_GOLD => [
|
||||
['name' => 'Microserve', 'confirmed' => true],
|
||||
],
|
||||
Sponsor::LEVEL_SILVER => [
|
||||
['name' => 'Drupalize.me', 'confirmed' => true],
|
||||
],
|
||||
];
|
||||
|
||||
$sponsors = $this->extension->getSponsors($data, Sponsor::LEVEL_SILVER);
|
||||
|
||||
$this->assertCount(1, $sponsors);
|
||||
$this->assertSame('Drupalize.me', $sponsors[0]['name']);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
|
|
Loading…
Reference in a new issue