Events with no date are not returned
GH-160
This commit is contained in:
parent
1c3d7f820f
commit
2133af2a4a
2 changed files with 28 additions and 0 deletions
|
@ -57,4 +57,30 @@ class RetrievingEventsTest extends TestCase
|
|||
|
||||
$this->assertCount(2, $events);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function events_with_no_date_are_not_returned()
|
||||
{
|
||||
$talks = [
|
||||
[
|
||||
'title' => 'Deploying PHP applications with Ansible, Ansible Vault and Ansistrano',
|
||||
'events' => [
|
||||
[
|
||||
'event' => 'php_south_wales',
|
||||
'date' => (new DateTime('-1 days'))->getTimestamp(),
|
||||
],
|
||||
[
|
||||
'event' => 'drupal_edinburgh',
|
||||
'date' => '',
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$this->assertSame(1, $this->extension->getPastTalkCount($talks));
|
||||
|
||||
$pastEvents = $this->extension->getPastEvents($talks);
|
||||
$this->assertCount(1, $pastEvents);
|
||||
$this->assertSame('php_south_wales', $pastEvents[0]['event']);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue