Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Commit

Permalink
III-2167: Fix code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
bertramakers committed Jun 26, 2017
1 parent 8f8b308 commit d625d7a
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/Event/EventJsonDocumentTransformerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -506,4 +506,20 @@ public function it_should_transform_addresses_in_a_deprecated_format()

$this->assertJsonDocumentPropertiesEquals($this, $expectedDocument, $actualDocument);
}

/**
* @test
*/
public function it_should_copy_languages_and_completed_languages_if_present_on_the_json_ld()
{
$original = file_get_contents(__DIR__ . '/data/original-with-languages.json');
$originalDocument = new JsonDocument('23017cb7-e515-47b4-87c4-780735acc942', $original);

$expected = file_get_contents(__DIR__ . '/data/indexed.json');
$expectedDocument = new JsonDocument('23017cb7-e515-47b4-87c4-780735acc942', $expected);

$actualDocument = $this->transformer->transform($originalDocument);

$this->assertJsonDocumentPropertiesEquals($this, $expectedDocument, $actualDocument);
}
}
32 changes: 32 additions & 0 deletions tests/Event/data/original-with-languages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"@id": "http:\/\/udb-silex.dev\/event\/23017cb7-e515-47b4-87c4-780735acc942",
"mainLanguage": "nl",
"name": {
"nl": "Punkfest"
},
"calendarType": "single",
"startDate": "2017-04-22T10:00:00+02:00",
"endDate": "2017-04-22T18:00:00+02:00",
"availableTo": "2017-04-22T18:00:00+02:00",
"location": {
"@id": "http:\/\/udb-silex.dev\/place\/179c89c5-dba4-417b-ae96-62e7a12c2405",
"name": {
"nl": "Hungaria"
},
"address": {
"nl": {
"addressCountry": "BE",
"addressLocality": "Leuven",
"postalCode": "3000",
"streetAddress": "Vaartkom 35"
}
},
"languages": ["nl"],
"completedLanguages": ["nl"]
},
"workflowStatus": "DRAFT",
"created": "2017-04-22T13:33:37+02:00",
"creator": "Jane Doe",
"languages": ["nl"],
"completedLanguages": ["nl"]
}

0 comments on commit d625d7a

Please sign in to comment.