From 1003e50feffe206b7de5aab13edddd49f0fe9c6d Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 7 Nov 2017 20:50:03 +0000 Subject: [PATCH] Also check the talk titles --- tests/FormatTalksBundle/Twig/FormatTalksTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/FormatTalksBundle/Twig/FormatTalksTest.php b/tests/FormatTalksBundle/Twig/FormatTalksTest.php index bba56343..0d91e929 100644 --- a/tests/FormatTalksBundle/Twig/FormatTalksTest.php +++ b/tests/FormatTalksBundle/Twig/FormatTalksTest.php @@ -48,11 +48,19 @@ class FormatTalksTest extends TestCase ['event' => 'event-b', 'date' => '2018-01-30', 'time' => '12:00'], ], ], + [ + 'title' => 'Talk B', + 'events' => [ + ['event' => 'event-b', 'date' => '2018-01-31', 'time' => '17:00'], + ], + ], ], ]; $results = $this->extension->format($data)->all(); + $this->assertCount(3, $results); + tap($results[0], function ($result) { $this->assertArrayHasKey('event', $result); $this->assertArrayHasKey('talk', $result); @@ -65,6 +73,8 @@ class FormatTalksTest extends TestCase 'time' => '09:00', 'website' => 'http://event-a.com', ], $result['event']); + + $this->assertEquals('Talk A', $result['talk']['title']); }); tap($results[1], function ($result) { @@ -79,6 +89,12 @@ class FormatTalksTest extends TestCase 'time' => '12:00', 'website' => 'http://event-b.com', ], $result['event']); + + $this->assertEquals('Talk A', $result['talk']['title']); + }); + + tap($results[2], function ($result) { + $this->assertEquals('Talk B', $result['talk']['title']); }); }