diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/RDFTestHelper.php b/core/modules/rdf/lib/Drupal/rdf/Tests/RDFTestHelper.php deleted file mode 100644 index e3d3394..0000000 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/RDFTestHelper.php +++ /dev/null @@ -1,31 +0,0 @@ - 'uri', - 'value' => $file_uri, - ), + $expected_value = array( + 'type' => 'uri', + 'value' => $file_uri, ); - $this->assertTrue(RDFTestHelper::GraphContainsTriple($rdf_output, $expected_triple), 'Node to file relation found in RDF output (rdfs:seeAlso).'); + $this->assertTrue($graph->hasProperty($node_uri, 'http://www.w3.org/2000/01/rdf-schema#seeAlso', $expected_value), 'Node to file relation found in RDF output (rdfs:seeAlso).'); // Node relations to attached image. - $expected_triple = array( - $node_uri, - 'http://www.w3.org/2000/01/rdf-schema#seeAlso', - array ( - 'type' => 'uri', - 'value' => $image_uri, - ), + $expected_value = array( + 'type' => 'uri', + 'value' => $image_uri, ); - $this->assertTrue(RDFTestHelper::GraphContainsTriple($rdf_output, $expected_triple), 'Node to file relation found in RDF output (rdfs:seeAlso).'); - $expected_triple = array( - $node_uri, - 'http://ogp.me/ns#image', - array ( - 'type' => 'uri', - 'value' => $image_uri, - ), + $this->assertTrue($graph->hasProperty($node_uri, 'http://www.w3.org/2000/01/rdf-schema#seeAlso', $expected_value), 'Node to file relation found in RDF output (rdfs:seeAlso).'); + $expected_value = array( + 'type' => 'uri', + 'value' => $image_uri, ); - $this->assertTrue(RDFTestHelper::GraphContainsTriple($rdf_output, $expected_triple), 'Node to file relation found in RDF output (og:image).'); + $this->assertTrue($graph->hasProperty($node_uri, 'http://ogp.me/ns#image', $expected_value), 'Node to file relation found in RDF output (og:image).'); // Image type. - $expected_triple = array( - $image_uri, - 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', - array ( - 'type' => 'uri', - 'value' => 'http://xmlns.com/foaf/0.1/Image', - ), + $expected_value = array( + 'type' => 'uri', + 'value' => 'http://xmlns.com/foaf/0.1/Image', ); - $this->assertTrue(RDFTestHelper::GraphContainsTriple($rdf_output, $expected_triple), 'Image type found in RDF output (foaf:Image).'); + $this->assertTrue($graph->hasProperty($image_uri, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', $expected_value), 'Image type found in RDF output (foaf:Image).'); // Node relations to taxonomy terms. - $expected_triple = array( - $node_uri, - 'http://purl.org/dc/terms/subject', - array ( - 'type' => 'uri', - 'value' => $taxonomy_term_1_uri, - ), + $expected_value = array( + 'type' => 'uri', + 'value' => $taxonomy_term_1_uri, ); - $this->assertTrue(RDFTestHelper::GraphContainsTriple($rdf_output, $expected_triple), 'Node to term found in RDF output (dc:subject).'); - $expected_triple = array( - $node_uri, - 'http://purl.org/dc/terms/subject', - array ( - 'type' => 'uri', - 'value' => $taxonomy_term_2_uri, - ), + $this->assertTrue($graph->hasProperty($node_uri, 'http://purl.org/dc/terms/subject', $expected_value), 'Node to term relation found in RDF output (dc:subject).'); + $expected_value = array( + 'type' => 'uri', + 'value' => $taxonomy_term_2_uri, ); - $this->assertTrue(RDFTestHelper::GraphContainsTriple($rdf_output, $expected_triple), 'Node to term found in RDF output (dc:subject).'); + $this->assertTrue($graph->hasProperty($node_uri, 'http://purl.org/dc/terms/subject', $expected_value), 'Node to term relation found in RDF output (dc:subject).'); // Taxonomy terms triples. // Term 1. - $expected_triple = array( - $taxonomy_term_1_uri, - 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', - array ( - 'type' => 'uri', - 'value' => 'http://www.w3.org/2004/02/skos/core#Concept', - ), - ); - $this->assertTrue(RDFTestHelper::GraphContainsTriple($rdf_output, $expected_triple), 'Taxonomy term type found in RDF output (skos:Concept).'); - $expected_triple = array( - $taxonomy_term_1_uri, - 'http://www.w3.org/2000/01/rdf-schema#label', - array ( - 'type' => 'literal', - 'value' => $tag1, - 'lang' => 'en', - ), - ); - $this->assertTrue(RDFTestHelper::GraphContainsTriple($rdf_output, $expected_triple), 'Taxonomy term name found in RDF output (rdfs:label).'); - $expected_triple = array( - $taxonomy_term_1_uri, - 'http://www.w3.org/2004/02/skos/core#prefLabel', - array ( - 'type' => 'literal', - 'value' => $tag1, - 'lang' => 'en', - ), - ); - $this->assertTrue(RDFTestHelper::GraphContainsTriple($rdf_output, $expected_triple), 'Taxonomy term name found in RDF output (skos:prefLabel).'); + $expected_value = array( + 'type' => 'uri', + 'value' => 'http://www.w3.org/2004/02/skos/core#Concept', + ); + $this->assertTrue($graph->hasProperty($taxonomy_term_1_uri, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', $expected_value), 'Taxonomy term type found in RDF output (skos:Concept).'); + $expected_value = array( + 'type' => 'literal', + 'value' => $tag1, + 'lang' => 'en', + ); + $this->assertTrue($graph->hasProperty($taxonomy_term_1_uri, 'http://www.w3.org/2000/01/rdf-schema#label', $expected_value), 'Taxonomy term name found in RDF output (rdfs:label).'); + $expected_value = array( + 'type' => 'literal', + 'value' => $tag1, + 'lang' => 'en', + ); + $this->assertTrue($graph->hasProperty($taxonomy_term_1_uri, 'http://www.w3.org/2004/02/skos/core#prefLabel', $expected_value), 'Taxonomy term name found in RDF output (skos:prefLabel).'); // Term 2. - $expected_triple = array( - $taxonomy_term_2_uri, - 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', - array ( - 'type' => 'uri', - 'value' => 'http://www.w3.org/2004/02/skos/core#Concept', - ), - ); - $this->assertTrue(RDFTestHelper::GraphContainsTriple($rdf_output, $expected_triple), 'Taxonomy term type found in RDF output (skos:Concept).'); - $expected_triple = array( - $taxonomy_term_2_uri, - 'http://www.w3.org/2000/01/rdf-schema#label', - array ( - 'type' => 'literal', - 'value' => $tag2, - 'lang' => 'en', - ), - ); - $this->assertTrue(RDFTestHelper::GraphContainsTriple($rdf_output, $expected_triple), 'Taxonomy term name found in RDF output (rdfs:label).'); - $expected_triple = array( - $taxonomy_term_2_uri, - 'http://www.w3.org/2004/02/skos/core#prefLabel', - array ( - 'type' => 'literal', - 'value' => $tag2, - 'lang' => 'en', - ), - ); - $this->assertTrue(RDFTestHelper::GraphContainsTriple($rdf_output, $expected_triple), 'Taxonomy term name found in RDF output (skos:prefLabel).'); + $expected_value = array( + 'type' => 'uri', + 'value' => 'http://www.w3.org/2004/02/skos/core#Concept', + ); + $this->assertTrue($graph->hasProperty($taxonomy_term_2_uri, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', $expected_value), 'Taxonomy term type found in RDF output (skos:Concept).'); + $expected_value = array( + 'type' => 'literal', + 'value' => $tag2, + 'lang' => 'en', + ); + $this->assertTrue($graph->hasProperty($taxonomy_term_2_uri, 'http://www.w3.org/2000/01/rdf-schema#label', $expected_value), 'Taxonomy term name found in RDF output (rdfs:label).'); + $expected_value = array( + 'type' => 'literal', + 'value' => $tag2, + 'lang' => 'en', + ); + $this->assertTrue($graph->hasProperty($taxonomy_term_2_uri, 'http://www.w3.org/2004/02/skos/core#prefLabel', $expected_value), 'Taxonomy term name found in RDF output (skos:prefLabel).'); } }