-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace
json_encode
with Json::encode
- Loading branch information
1 parent
ce61f48
commit f031b82
Showing
44 changed files
with
159 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
namespace CultuurNet\UDB3\Contributor; | ||
|
||
use CultuurNet\UDB3\Json; | ||
use CultuurNet\UDB3\Model\ValueObject\Identity\UUID; | ||
use CultuurNet\UDB3\Model\ValueObject\Web\EmailAddress; | ||
use CultuurNet\UDB3\Model\ValueObject\Web\EmailAddresses; | ||
|
@@ -80,15 +81,15 @@ public function it_add_contributors_if_user_has_permission(string $itemType): vo | |
); | ||
|
||
|
||
$jsonLd = new JsonDocument($this->offerId, json_encode(['@type' => $itemType])); | ||
$jsonLd = new JsonDocument($this->offerId, Json::encode(['@type' => $itemType])); | ||
$this->documentRepository->save($jsonLd); | ||
|
||
$fetchJsonLd = $this->contributorEnrichedRepository->fetch($this->offerId, false); | ||
|
||
$this->assertEquals( | ||
new JsonDocument( | ||
$this->offerId, | ||
json_encode([ | ||
Json::encode([ | ||
'@type' => $itemType, | ||
'contributors' => [ | ||
'[email protected]', | ||
|
@@ -123,15 +124,15 @@ public function it_does_not_add_contributors_if_there_are_none(string $itemType) | |
); | ||
|
||
|
||
$jsonLd = new JsonDocument($this->offerId, json_encode(['@type' => $itemType])); | ||
$jsonLd = new JsonDocument($this->offerId, Json::encode(['@type' => $itemType])); | ||
$this->documentRepository->save($jsonLd); | ||
|
||
$fetchJsonLd = $this->contributorEnrichedRepository->fetch($this->offerId, false); | ||
|
||
$this->assertEquals( | ||
new JsonDocument( | ||
$this->offerId, | ||
json_encode([ | ||
Json::encode([ | ||
'@type' => $itemType, | ||
]) | ||
), | ||
|
@@ -159,15 +160,15 @@ public function it_hides_contributors_if_user_has_no_permission(string $itemType | |
->with(new UUID($this->offerId)); | ||
|
||
|
||
$jsonLd = new JsonDocument($this->offerId, json_encode(['@type' => $itemType])); | ||
$jsonLd = new JsonDocument($this->offerId, Json::encode(['@type' => $itemType])); | ||
$this->documentRepository->save($jsonLd); | ||
|
||
$fetchJsonLd = $this->contributorEnrichedRepository->fetch($this->offerId); | ||
|
||
$this->assertEquals( | ||
new JsonDocument( | ||
$this->offerId, | ||
json_encode([ | ||
Json::encode([ | ||
'@type' => $itemType, | ||
]) | ||
), | ||
|
@@ -184,7 +185,7 @@ public function it_does_not_save_contributors(string $itemType): void | |
$this->contributorEnrichedRepository->save( | ||
new JsonDocument( | ||
$this->offerId, | ||
json_encode([ | ||
Json::encode([ | ||
'@type' => $itemType, | ||
'contributors' => [ | ||
'[email protected]', | ||
|
@@ -197,7 +198,7 @@ public function it_does_not_save_contributors(string $itemType): void | |
$this->assertEquals( | ||
new JsonDocument( | ||
$this->offerId, | ||
json_encode(['@type' => $itemType]) | ||
Json::encode(['@type' => $itemType]) | ||
), | ||
$this->contributorEnrichedRepository->fetch($this->offerId) | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.