diff --git a/composer.json b/composer.json index f9b6cf0..66561f5 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,8 @@ ], "require": { "sculpin/sculpin": "^3", - "tightenco/collect": "^5.8" + "tightenco/collect": "^5.8", + "josephlavin/tap": "^1.0" }, "scripts": { "dev": "composer run-script generate", diff --git a/composer.lock b/composer.lock index 1cae684..664b924 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2f8c5422287b9307fc790139f2c65ba7", + "content-hash": "c6414f5b440058283f14445f290d6df4", "packages": [ { "name": "dflydev/ant-path-matcher", @@ -446,6 +446,45 @@ ], "time": "2017-07-23T21:35:13+00:00" }, + { + "name": "josephlavin/tap", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/josephlavin/tap.git", + "reference": "8733d96fb9b7d7dca204dfe59ec3ff34f3c69be9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/josephlavin/tap/zipball/8733d96fb9b7d7dca204dfe59ec3ff34f3c69be9", + "reference": "8733d96fb9b7d7dca204dfe59ec3ff34f3c69be9", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "require-dev": { + "phpunit/phpunit": "~5.7" + }, + "type": "library", + "autoload": { + "files": [ + "src/tap.php", + "src/TapProxy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Stand alone port of Laravel's tap method.", + "keywords": [ + "laravel", + "php", + "tap" + ], + "time": "2017-09-24T23:36:28+00:00" + }, { "name": "michelf/php-markdown", "version": "1.8.0", diff --git a/src/Speakers/tests/SpeakerTest.php b/src/Speakers/tests/SpeakerTest.php index d8ae9fc..ae22490 100644 --- a/src/Speakers/tests/SpeakerTest.php +++ b/src/Speakers/tests/SpeakerTest.php @@ -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']); + }); } }