From 8ddab8b1de40c848d0eaa47628976bf7d25756d2 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Sat, 17 Feb 2018 21:49:35 +0000 Subject: [PATCH] Add test for OwnYourSwarm request with h-adr location value --- tests/Feature/SwarmTest.php | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/Feature/SwarmTest.php b/tests/Feature/SwarmTest.php index 7e8f133b..8f92c4f3 100644 --- a/tests/Feature/SwarmTest.php +++ b/tests/Feature/SwarmTest.php @@ -187,4 +187,45 @@ class SwarmTest extends TestCase 'name' => 'Awesome Venue', ]); } + + public function test_ownyourswarm_request_with_hadr_location() + { + $response = $this->json( + 'POST', + 'api/post', + [ + 'type' => ['h-entry'], + 'properties' => [ + 'published' => [\Carbon\Carbon::now()->toDateTimeString()], + 'syndication' => ['https://www.swarmapp.com/checkin/abc'], + 'content' => [[ + 'value' => 'My first #checkin using Example Product', + 'html' => 'My first #checkin using Example Product', + ]], + 'location' => [[ + 'type' => ['h-adr'], + 'properties' => [ + 'latitude' => ['1.23'], + 'longitude' => ['4.56'], + 'street-address' => ['Awesome Street'], + ], + ]], + 'checkin' => [[ + 'type' => ['h-card'], + 'properties' => [ + 'name' => ['Awesome Venue'], + 'url' => ['https://foursquare.com/v/123456'], + ], + ]], + ], + ], + ['HTTP_Authorization' => 'Bearer ' . $this->getToken()] + ); + $response + ->assertStatus(201) + ->assertJson(['response' => 'created']); + $this->assertDatabaseMissing('places', [ + 'name' => 'Awesome Venue', + ]); + } }