Get speakers for a session

This commit is contained in:
Oliver Davies 2019-05-21 08:00:47 +01:00
parent 1024e7d992
commit 61c5325f78
3 changed files with 73 additions and 3 deletions

View file

@ -38,6 +38,36 @@ class SpeakerTest extends TestCase
/** @test */
public function get_speakers_for_a_session()
{
$this->markTestIncomplete();
$speakers = [
['title' => 'Oliver Davies'],
['title' => 'Phil Thomas'],
['title' => 'Tom Metcalfe'],
['title' => 'Ross Gratton'],
['title' => 'Dan McNamara'],
];
$session1 = [
'title' => 'Drupal in a microservice savannah',
'speakers' => [
'Phil Thomas',
'Ross Gratton',
],
];
$session2 = [
'title' => 'The Real State of Drupal',
'speakers' => ['Dan McNamara'],
];
tap($this->extension->getSessionSpeakers($session1, $speakers), function (array $speakers) {
$this->assertCount(2, $speakers);
$this->assertSame('Phil Thomas', $speakers[0]['title']);
$this->assertSame('Ross Gratton', $speakers[1]['title']);
});
tap($this->extension->getSessionSpeakers($session2, $speakers), function (array $speakers) {
$this->assertCount(1, $speakers);
$this->assertSame('Dan McNamara', $speakers[0]['title']);
});
}
}