Fix time issue

This commit is contained in:
Oliver Davies 2018-08-31 00:33:34 +01:00
parent 0fb108f6a1
commit ad8582b8c9
2 changed files with 4 additions and 3 deletions

View file

@ -17,6 +17,7 @@ class FormatTalksExtension extends Twig_Extension
public function __construct()
{
$this->today = (new \DateTime())
->modify('today')
->setTimezone(new \DateTimeZone('Europe/London'))
->format('Y-m-d');
}

View file

@ -56,11 +56,11 @@ class FormatTalksTest extends TestCase
],
];
$results = $this->extension->format($talks, $event_data)->all();
$results = $this->extension->format($talks, $event_data);
$this->assertCount(3, $results);
tap($results[0], function ($result) {
tap($results->first(), function ($result) {
$this->assertArrayHasKey('event', $result);
$this->assertArrayHasKey('talk', $result);
@ -76,7 +76,7 @@ class FormatTalksTest extends TestCase
$this->assertEquals('Talk A', $result['talk']['title']);
});
tap($results[1], function ($result) {
tap($results->get(1), function ($result) {
$this->assertArrayHasKey('event', $result);
$this->assertArrayHasKey('talk', $result);