|
|
@ -2,6 +2,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
namespace Drupal\Tests\islandora\Functional; |
|
|
|
namespace Drupal\Tests\islandora\Functional; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use function GuzzleHttp\json_decode; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Class MappingUriPredicateReactionTest. |
|
|
|
* Class MappingUriPredicateReactionTest. |
|
|
|
* |
|
|
|
* |
|
|
@ -13,7 +15,7 @@ class JsonldSelfReferenceReactionTest extends IslandoraFunctionalTestBase { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* {@inheritdoc} |
|
|
|
* {@inheritdoc} |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function setUp() { |
|
|
|
public function setUp(): void { |
|
|
|
parent::setUp(); |
|
|
|
parent::setUp(); |
|
|
|
|
|
|
|
|
|
|
|
$types = ['schema:Thing']; |
|
|
|
$types = ['schema:Thing']; |
|
|
@ -61,7 +63,7 @@ class JsonldSelfReferenceReactionTest extends IslandoraFunctionalTestBase { |
|
|
|
|
|
|
|
|
|
|
|
$contents = $this->drupalGet($url . '?_format=jsonld'); |
|
|
|
$contents = $this->drupalGet($url . '?_format=jsonld'); |
|
|
|
$this->assertSession()->statusCodeEquals(200); |
|
|
|
$this->assertSession()->statusCodeEquals(200); |
|
|
|
$json = \GuzzleHttp\json_decode($contents, TRUE); |
|
|
|
$json = json_decode($contents, TRUE); |
|
|
|
$this->assertArrayHasKey('http://purl.org/dc/terms/title', |
|
|
|
$this->assertArrayHasKey('http://purl.org/dc/terms/title', |
|
|
|
$json['@graph'][0], 'Missing dcterms:title key'); |
|
|
|
$json['@graph'][0], 'Missing dcterms:title key'); |
|
|
|
$this->assertEquals( |
|
|
|
$this->assertEquals( |
|
|
@ -103,7 +105,7 @@ class JsonldSelfReferenceReactionTest extends IslandoraFunctionalTestBase { |
|
|
|
drupal_flush_all_caches(); |
|
|
|
drupal_flush_all_caches(); |
|
|
|
|
|
|
|
|
|
|
|
$new_contents = $this->drupalGet($url . '?_format=jsonld'); |
|
|
|
$new_contents = $this->drupalGet($url . '?_format=jsonld'); |
|
|
|
$json = \GuzzleHttp\json_decode($new_contents, TRUE); |
|
|
|
$json = json_decode($new_contents, TRUE); |
|
|
|
$this->assertEquals( |
|
|
|
$this->assertEquals( |
|
|
|
'Test Node', |
|
|
|
'Test Node', |
|
|
|
$json['@graph'][0]['http://purl.org/dc/terms/title'][0]['@value'], |
|
|
|
$json['@graph'][0]['http://purl.org/dc/terms/title'][0]['@value'], |
|
|
@ -123,7 +125,7 @@ class JsonldSelfReferenceReactionTest extends IslandoraFunctionalTestBase { |
|
|
|
$this->assertSession() |
|
|
|
$this->assertSession() |
|
|
|
->pageTextContains("The context $context_name has been saved"); |
|
|
|
->pageTextContains("The context $context_name has been saved"); |
|
|
|
$new_contents = $this->drupalGet($url . '?_format=jsonld'); |
|
|
|
$new_contents = $this->drupalGet($url . '?_format=jsonld'); |
|
|
|
$json = \GuzzleHttp\json_decode($new_contents, TRUE); |
|
|
|
$json = json_decode($new_contents, TRUE); |
|
|
|
$this->assertEquals( |
|
|
|
$this->assertEquals( |
|
|
|
'Test Node', |
|
|
|
'Test Node', |
|
|
|
$json['@graph'][0]['http://purl.org/dc/terms/title'][0]['@value'], |
|
|
|
$json['@graph'][0]['http://purl.org/dc/terms/title'][0]['@value'], |
|
|
@ -161,7 +163,7 @@ class JsonldSelfReferenceReactionTest extends IslandoraFunctionalTestBase { |
|
|
|
|
|
|
|
|
|
|
|
$contents = $this->drupalGet($media_url . '?_format=jsonld'); |
|
|
|
$contents = $this->drupalGet($media_url . '?_format=jsonld'); |
|
|
|
$this->assertSession()->statusCodeEquals(200); |
|
|
|
$this->assertSession()->statusCodeEquals(200); |
|
|
|
$json = \GuzzleHttp\json_decode($contents, TRUE); |
|
|
|
$json = json_decode($contents, TRUE); |
|
|
|
$this->assertEquals( |
|
|
|
$this->assertEquals( |
|
|
|
"$media_url?_format=jsonld", |
|
|
|
"$media_url?_format=jsonld", |
|
|
|
$json['@graph'][0]['@id'], |
|
|
|
$json['@graph'][0]['@id'], |
|
|
@ -186,7 +188,7 @@ class JsonldSelfReferenceReactionTest extends IslandoraFunctionalTestBase { |
|
|
|
drupal_flush_all_caches(); |
|
|
|
drupal_flush_all_caches(); |
|
|
|
|
|
|
|
|
|
|
|
$new_contents = $this->drupalGet($media_url . '?_format=jsonld'); |
|
|
|
$new_contents = $this->drupalGet($media_url . '?_format=jsonld'); |
|
|
|
$json = \GuzzleHttp\json_decode($new_contents, TRUE); |
|
|
|
$json = json_decode($new_contents, TRUE); |
|
|
|
$this->assertEquals( |
|
|
|
$this->assertEquals( |
|
|
|
"$media_url?_format=jsonld", |
|
|
|
"$media_url?_format=jsonld", |
|
|
|
$json['@graph'][0]['http://www.iana.org/assignments/relation/describedby'][0]['@id'], |
|
|
|
$json['@graph'][0]['http://www.iana.org/assignments/relation/describedby'][0]['@id'], |
|
|
|