Change filters into functions
This commit is contained in:
parent
7955042ec0
commit
1c3d7f820f
4 changed files with 39 additions and 90 deletions
|
@ -50,43 +50,7 @@ class RetrievingEventsTest extends TestCase
|
|||
];
|
||||
|
||||
$talks = $this->extension->getAllTalks([$talkA, $talkB]);
|
||||
$events = $this->extension->filterPastEvents($talks);
|
||||
|
||||
$this->assertInstanceOf(Collection::class, $talks);
|
||||
$this->assertInstanceOf(Collection::class, $events);
|
||||
|
||||
$this->assertCount(2, $events);
|
||||
}
|
||||
/** @test */
|
||||
public function get_current_or_upcoming_events()
|
||||
{
|
||||
$talkA = [
|
||||
'title' => 'Test Driven Drupal',
|
||||
'events' => [
|
||||
[
|
||||
'event' => 'php_south_wales',
|
||||
'date' => (new DateTime('+0 days'))->getTimestamp(),
|
||||
],
|
||||
[
|
||||
'event' => 'drupalcamp_london',
|
||||
'date' => (new DateTime('-1 days'))->getTimestamp(),
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$talkB = [
|
||||
'title' => 'Taking Flight with Tailwind CSS',
|
||||
'events' => [
|
||||
[
|
||||
'event' => 'blue_conf_2019',
|
||||
'date' => (new DateTime('+2 days'))->getTimestamp(),
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
$talks = $this->extension->getAllTalks([$talkA, $talkB]);
|
||||
$events = $this->extension->filterUpcomingEvents($talks);
|
||||
$events = $this->extension->getPastEvents($talks);
|
||||
|
||||
$this->assertInstanceOf(Collection::class, $talks);
|
||||
$this->assertInstanceOf(Collection::class, $events);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue