Skip to content
This repository has been archived by the owner on Jun 23, 2021. It is now read-only.

Commit

Permalink
III-1686: Projection of organizer labels has recently changed, so det…
Browse files Browse the repository at this point in the history
…ection of uitpas labels had to be fixed.
  • Loading branch information
bertramakers committed Dec 9, 2016
1 parent cbe68ea commit 296c7f5
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 81 deletions.
2 changes: 1 addition & 1 deletion src/Specification/IsUiTPASOrganizerAccordingToJSONLD.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function isSatisfiedBy($organizerId)
$uitpasLabelsPresentOnOrganizer = array_filter(
$organizerLabels,
function ($label) {
$label = new Label($label->name);
$label = new Label($label);
return $this->uitpasLabels->contains($label);
}
);
Expand Down
50 changes: 10 additions & 40 deletions tests/Specification/IsUiTPASOrganizerAccordingToJSONLDTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,24 +130,12 @@ public function it_returns_true_for_organizers_with_an_exact_uitpas_label_match(
$expectedLabelLogContext = $expectedLogContext + [
'uitpas_labels' => $this->uitpasLabels->asArray(),
'extracted_organizer_labels' => [
(object) [
'uuid' => '71945e50-2158-4922-94d2-fd1da6286b51',
'name' => 'foo',
],
(object) [
'uuid' => '12dabcf9-9598-4e8d-8642-c1af42698875',
'name' => 'UiTPAS',
],
(object) [
'uuid' => '9fac1824-8c65-4d0e-845f-9bef03fa05a1',
'name' => 'bar',
],
'foo',
'UiTPAS',
'bar',
],
'organizer_uitpas_labels' => [
(object) [
'uuid' => '12dabcf9-9598-4e8d-8642-c1af42698875',
'name' => 'UiTPAS',
],
'UiTPAS',
],
];

Expand Down Expand Up @@ -175,24 +163,12 @@ public function it_returns_true_for_organizers_with_a_case_insensitive_uitpas_la
$expectedLabelLogContext = $expectedLogContext + [
'uitpas_labels' => $this->uitpasLabels->asArray(),
'extracted_organizer_labels' => [
(object) [
'uuid' => '71945e50-2158-4922-94d2-fd1da6286b51',
'name' => 'foo',
],
(object) [
'uuid' => '12dabcf9-9598-4e8d-8642-c1af42698875',
'name' => 'uitpas',
],
(object) [
'uuid' => '9fac1824-8c65-4d0e-845f-9bef03fa05a1',
'name' => 'bar',
],
'foo',
'uitpas',
'bar',
],
'organizer_uitpas_labels' => [
(object) [
'uuid' => '12dabcf9-9598-4e8d-8642-c1af42698875',
'name' => 'uitpas',
],
'uitpas',
],
];

Expand Down Expand Up @@ -220,14 +196,8 @@ public function it_returns_false_for_organizers_without_uitpas_label()
$expectedLabelLogContext = $expectedLogContext + [
'uitpas_labels' => $this->uitpasLabels->asArray(),
'extracted_organizer_labels' => [
(object) [
'uuid' => '71945e50-2158-4922-94d2-fd1da6286b51',
'name' => 'foo',
],
(object) [
'uuid' => '9fac1824-8c65-4d0e-845f-9bef03fa05a1',
'name' => 'bar',
],
'foo',
'bar',
],
'organizer_uitpas_labels' => [],
];
Expand Down
15 changes: 3 additions & 12 deletions tests/Specification/samples/organizer-with-lowercase-uitpas-label
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
{
"@id": "http://example.com/organizers/dba1c53d-582c-4081-a78c-b4848f9e3653",
"labels": [
{
"uuid": "71945e50-2158-4922-94d2-fd1da6286b51",
"name": "foo"
},
{
"uuid": "12dabcf9-9598-4e8d-8642-c1af42698875",
"name": "uitpas"
},
{
"uuid": "9fac1824-8c65-4d0e-845f-9bef03fa05a1",
"name": "bar"
}
"foo",
"uitpas",
"bar"
]
}
10 changes: 2 additions & 8 deletions tests/Specification/samples/organizer-with-syntax-error
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{
"@id": "http://example.com/organizers/dba1c53d-582c-4081-a78c-b4848f9e3653",
"labels": [
{
"uuid": "71945e50-2158-4922-94d2-fd1da6286b51",
"name": "foo"
},
{
"uuid": "12dabcf9-9598-4e8d-8642-c1af42698875",
"name": "uitpas"
},
"foo",
"uitpas",
15 changes: 3 additions & 12 deletions tests/Specification/samples/organizer-with-uitpas-label
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
{
"@id": "http://example.com/organizers/dba1c53d-582c-4081-a78c-b4848f9e3653",
"labels": [
{
"uuid": "71945e50-2158-4922-94d2-fd1da6286b51",
"name": "foo"
},
{
"uuid": "12dabcf9-9598-4e8d-8642-c1af42698875",
"name": "UiTPAS"
},
{
"uuid": "9fac1824-8c65-4d0e-845f-9bef03fa05a1",
"name": "bar"
}
"foo",
"UiTPAS",
"bar"
]
}
10 changes: 2 additions & 8 deletions tests/Specification/samples/organizer-without-uitpas-label
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
{
"@id": "http://example.com/organizers/dba1c53d-582c-4081-a78c-b4848f9e3653",
"labels": [
{
"uuid": "71945e50-2158-4922-94d2-fd1da6286b51",
"name": "foo"
},
{
"uuid": "9fac1824-8c65-4d0e-845f-9bef03fa05a1",
"name": "bar"
}
"foo",
"bar"
]
}

0 comments on commit 296c7f5

Please sign in to comment.