diff --git a/core/modules/rdf/lib/Drupal/rdf/CommonDataConverter.php b/core/modules/rdf/lib/Drupal/rdf/CommonDataConverter.php index e27f48b..2219f6b 100644 --- a/core/modules/rdf/lib/Drupal/rdf/CommonDataConverter.php +++ b/core/modules/rdf/lib/Drupal/rdf/CommonDataConverter.php @@ -20,7 +20,7 @@ class CommonDataConverter { * @return mixed * Returns the data. */ - static function rawValue($data) { + public static function rawValue($data) { return $data; } } diff --git a/core/modules/rdf/lib/Drupal/rdf/SchemaOrgDataConverter.php b/core/modules/rdf/lib/Drupal/rdf/SchemaOrgDataConverter.php index 99fe670..708daf0 100644 --- a/core/modules/rdf/lib/Drupal/rdf/SchemaOrgDataConverter.php +++ b/core/modules/rdf/lib/Drupal/rdf/SchemaOrgDataConverter.php @@ -26,7 +26,7 @@ class SchemaOrgDataConverter { * * @see http://schema.org/UserInteraction */ - static function interactionCount($count, $arguments) { + public static function interactionCount($count, $arguments) { $interaction_type = $arguments['interaction_type']; return "$interaction_type:$count"; } diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php index f152e0b..b0395e1 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php @@ -22,6 +22,9 @@ class CommentAttributesTest extends CommentTestBase { */ public static $modules = array('views', 'node', 'comment', 'rdf'); + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'RDFa markup for comments', @@ -30,6 +33,9 @@ public static function getInfo() { ); } + /** + * {@inheritdoc} + */ public function setUp() { parent::setUp(); @@ -149,14 +155,14 @@ public function testCommentRdfaMarkup() { $parser = new \EasyRdf_Parser_Rdfa(); $graph = new \EasyRdf_Graph(); $parser->parse($graph, $this->drupalGet('node/' . $this->node->id()), 'rdfa', $this->base_uri); - $this->_testBasicCommentRdfaMarkup($graph, $comment1); + $this->testBasicCommentRdfaMarkup($graph, $comment1); // Tests comment #1 with no access to the user profile (as anonymous user). $this->drupalLogout(); $parser = new \EasyRdf_Parser_Rdfa(); $graph = new \EasyRdf_Graph(); $parser->parse($graph, $this->drupalGet('node/' . $this->node->id()), 'rdfa', $this->base_uri); - $this->_testBasicCommentRdfaMarkup($graph, $comment1); + $this->testBasicCommentRdfaMarkup($graph, $comment1); // Posts comment #2 as anonymous user. $anonymous_user = array(); @@ -169,14 +175,14 @@ public function testCommentRdfaMarkup() { $parser = new \EasyRdf_Parser_Rdfa(); $graph = new \EasyRdf_Graph(); $parser->parse($graph, $this->drupalGet('node/' . $this->node->id()), 'rdfa', $this->base_uri); - $this->_testBasicCommentRdfaMarkup($graph, $comment2, $anonymous_user); + $this->testBasicCommentRdfaMarkup($graph, $comment2, $anonymous_user); // Tests comment #2 as logged in user. $this->drupalLogin($this->web_user); $parser = new \EasyRdf_Parser_Rdfa(); $graph = new \EasyRdf_Graph(); $parser->parse($graph, $this->drupalGet('node/' . $this->node->id()), 'rdfa', $this->base_uri); - $this->_testBasicCommentRdfaMarkup($graph, $comment2, $anonymous_user); + $this->testBasicCommentRdfaMarkup($graph, $comment2, $anonymous_user); } /** @@ -222,12 +228,12 @@ public function testCommentReplyOfRdfaMarkup() { * * Tests the current page for basic comment RDFa markup. * - * @param $comment + * @param object $comment * Comment object. - * @param $account + * @param array $account * An array containing information about an anonymous user. */ - function _testBasicCommentRdfaMarkup($graph, CommentInterface $comment, $account = array()) { + public function testBasicCommentRdfaMarkup($graph, CommentInterface $comment, $account = array()) { $comment_uri = $comment->url('canonical', array('absolute' => TRUE)); // Comment type. @@ -316,20 +322,20 @@ function _testBasicCommentRdfaMarkup($graph, CommentInterface $comment, $account /** * Creates a comment entity. * - * @param $nid + * @param int $nid * Node id which will hold the comment. - * @param $uid + * @param int $uid * User id of the author of the comment. Can be NULL if $contact provided. - * @param $contact + * @param array $contact * Set to NULL for no contact info, TRUE to ignore success checking, and * array of values to set contact info. - * @param $pid + * @param int $pid * Comment id of the parent comment in a thread. * * @return \Drupal\comment\Entity\Comment * The saved comment. */ - function saveComment($nid, $uid, $contact = NULL, $pid = 0) { + public function saveComment($nid, $uid, $contact = NULL, $pid = 0) { $values = array( 'entity_id' => $nid, 'entity_type' => 'node', diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/CrudTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/CrudTest.php index 26f793d..199d22b 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/CrudTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/CrudTest.php @@ -21,6 +21,9 @@ class CrudTest extends DrupalUnitTestBase { */ public static $modules = array('entity_test', 'rdf', 'system'); + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'RDF mapping CRUD functions', @@ -29,6 +32,9 @@ public static function getInfo() { ); } + /** + * {@inheritdoc} + */ public function setUp() { parent::setUp(); $this->prefix = 'rdf.mapping'; @@ -38,7 +44,7 @@ public function setUp() { /** * Tests creation of RDF mapping. */ - function testMappingCreation() { + public function testMappingCreation() { $mapping_config_name = "{$this->prefix}.{$this->entity_type}.{$this->bundle}"; // Save bundle mapping config. @@ -51,7 +57,7 @@ function testMappingCreation() { /** * Test the handling of bundle mappings. */ - function testBundleMapping() { + public function testBundleMapping() { // Test that the bundle mapping can be saved. $types = array('sioc:Post', 'foaf:Document'); rdf_get_mapping($this->entity_type, $this->bundle) @@ -74,7 +80,7 @@ function testBundleMapping() { /** * Test the handling of field mappings. */ - function testFieldMapping() { + public function testFieldMapping() { $field_name = 'created'; // Test that the field mapping can be saved. diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/Field/DateTimeFieldRdfaTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/DateTimeFieldRdfaTest.php index d859f25..f3a3807 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/Field/DateTimeFieldRdfaTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/DateTimeFieldRdfaTest.php @@ -25,11 +25,11 @@ class DateTimeFieldRdfaTest extends FieldRdfaTestBase { */ protected $testValue = '2014-01-28T06:01:01'; - /** - * {@inheritdoc} - */ public static $modules = array('datetime'); + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'Field formatter: datetime', @@ -38,6 +38,9 @@ public static function getInfo() { ); } + /** + * {@inheritdoc} + */ public function setUp() { parent::setUp(); diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/Field/EmailFieldRdfaTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/EmailFieldRdfaTest.php index 4a3550d..f09c0b5 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/Field/EmailFieldRdfaTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/EmailFieldRdfaTest.php @@ -23,6 +23,9 @@ class EmailFieldRdfaTest extends FieldRdfaTestBase { */ public static $modules = array('email', 'text'); + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'Field formatter: email', @@ -30,7 +33,9 @@ public static function getInfo() { 'group' => 'RDF', ); } - + /** + * {@inheritdoc} + */ public function setUp() { parent::setUp(); diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/Field/FieldRdfaDatatypeCallbackTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/FieldRdfaDatatypeCallbackTest.php index 944082d..c8c3bec 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/Field/FieldRdfaDatatypeCallbackTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/FieldRdfaDatatypeCallbackTest.php @@ -21,6 +21,9 @@ class FieldRdfaDatatypeCallbackTest extends FieldRdfaTestBase { */ public static $modules = array('text', 'filter'); + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'Field formatter: datatype callback', @@ -29,6 +32,9 @@ public static function getInfo() { ); } + /** + * {@inheritdoc} + */ public function setUp() { parent::setUp(); @@ -59,6 +65,4 @@ public function testDefaultFormatter() { // Expected value is the output of the datatype callback, not the raw value. $this->assertFormatterRdfa('text_default', 'http://schema.org/interactionCount', 'foo' . $this->test_value); } - } - diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/Field/TaxonomyTermReferenceRdfaTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/TaxonomyTermReferenceRdfaTest.php index 4e4f7a1..98a6292 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/Field/TaxonomyTermReferenceRdfaTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/TaxonomyTermReferenceRdfaTest.php @@ -39,6 +39,9 @@ class TaxonomyTermReferenceRdfaTest extends FieldRdfaTestBase { */ public static $modules = array('taxonomy', 'options', 'text', 'filter'); + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'Field formatter: taxonomy term reference', @@ -47,6 +50,9 @@ public static function getInfo() { ); } + /** + * {@inheritdoc} + */ public function setUp() { parent::setUp(); diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/Field/TestDataConverter.php b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/TestDataConverter.php index 35b267a..68e47a9 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/Field/TestDataConverter.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/TestDataConverter.php @@ -20,7 +20,7 @@ class TestDataConverter { * @return string * Returns the data. */ - static function convertFoo($data) { + public static function convertFoo($data) { return 'foo' . $data['value']; } diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/Field/TextFieldRdfaTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/TextFieldRdfaTest.php index d10318c..43d263f 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/Field/TextFieldRdfaTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/TextFieldRdfaTest.php @@ -33,10 +33,13 @@ class TextFieldRdfaTest extends FieldRdfaTestBase { protected $testSummary = 'test_summary_value'; /** - * {@inheritdoc} - */ + * {@inheritdoc} + */ public static $modules = array('text'); + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'Field formatter: text', @@ -45,6 +48,9 @@ public static function getInfo() { ); } + /** + * {@inheritdoc} + */ public function setUp() { parent::setUp(); diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/FileFieldAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/FileFieldAttributesTest.php index cc738e4..75d625a 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/FileFieldAttributesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/FileFieldAttributesTest.php @@ -43,6 +43,9 @@ class FileFieldAttributesTest extends FileFieldTestBase { */ protected $node; + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'RDFa markup for files', @@ -51,6 +54,9 @@ public static function getInfo() { ); } + /** + * {@inheritdoc} + */ public function setUp() { parent::setUp(); $this->fieldName = strtolower($this->randomName()); @@ -83,7 +89,7 @@ public function setUp() { * Ensure that file fields have the correct resource as the object in RDFa * when displayed as a teaser. */ - function testNodeTeaser() { + public function testNodeTeaser() { // Render the teaser. $node_render_array = entity_view_multiple(array($this->node), 'teaser'); $html = drupal_render($node_render_array); diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/GetNamespacesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/GetNamespacesTest.php index 0457ee4..ba28c95 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/GetNamespacesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/GetNamespacesTest.php @@ -21,6 +21,9 @@ class GetNamespacesTest extends WebTestBase { */ public static $modules = array('rdf', 'rdf_test_namespaces'); + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'RDF namespaces serialization test', @@ -32,7 +35,7 @@ public static function getInfo() { /** * Tests RDF namespaces. */ - function testGetRdfNamespaces() { + public function testGetRdfNamespaces() { // Fetches the front page and extracts RDFa 1.1 prefixes. $this->drupalGet(''); diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php index db9ef14..be0bba9 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php @@ -21,6 +21,9 @@ class GetRdfNamespacesTest extends WebTestBase { */ public static $modules = array('rdf', 'rdf_test_namespaces'); + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'RDF namespaces', @@ -32,7 +35,7 @@ public static function getInfo() { /** * Tests getting RDF namespaces. */ - function testGetRdfNamespaces() { + public function testGetRdfNamespaces() { // Get all RDF namespaces. $ns = rdf_get_namespaces(); diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/ImageFieldAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/ImageFieldAttributesTest.php index 14af8f6..245483b 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/ImageFieldAttributesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/ImageFieldAttributesTest.php @@ -43,6 +43,9 @@ class ImageFieldAttributesTest extends ImageFieldTestBase { */ protected $node; + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'RDFa markup for imagefield', @@ -51,6 +54,9 @@ public static function getInfo() { ); } + /** + * {@inheritdoc} + */ public function setUp() { parent::setUp(); @@ -79,7 +85,7 @@ public function setUp() { /** * Tests that image fields in teasers have correct resources. */ - function testNodeTeaser() { + public function testNodeTeaser() { // Set the display options for the teaser. $display_options = array( 'type' => 'image', diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/NodeAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/NodeAttributesTest.php index 76e1af6..add8666 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/NodeAttributesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/NodeAttributesTest.php @@ -21,6 +21,9 @@ class NodeAttributesTest extends NodeTestBase { */ public static $modules = array('rdf'); + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'RDFa markup for nodes', @@ -29,6 +32,9 @@ public static function getInfo() { ); } + /** + * {@inheritdoc} + */ public function setUp() { parent::setUp(); @@ -50,7 +56,7 @@ public function setUp() { /** * Creates a node of type article and tests its RDFa markup. */ - function testNodeAttributes() { + public function testNodeAttributes() { // Create node with single quotation mark title to ensure it does not get // escaped more than once. $node = $this->drupalCreateNode(array( diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/RdfaAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/RdfaAttributesTest.php index 726e78b..e729f74 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/RdfaAttributesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/RdfaAttributesTest.php @@ -21,6 +21,9 @@ class RdfaAttributesTest extends DrupalUnitTestBase { */ public static $modules = array('rdf'); + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'RDFa attributes', @@ -32,19 +35,19 @@ public static function getInfo() { /** * Test attribute creation for mappings which use 'property'. */ - function testProperty() { + public function testProperty() { $properties = array('dc:title'); $mapping = array('properties' => $properties); $expected_attributes = array('property' => $properties); - $this->_testAttributes($expected_attributes, $mapping); + $this->testAttributes($expected_attributes, $mapping); } /** * Test attribute creation for mappings which use 'datatype'. */ - function testDatatype() { + public function testDatatype() { $properties = array('foo:bar1'); $datatype = 'foo:bar1type'; @@ -57,13 +60,13 @@ function testDatatype() { 'property' => $properties, ); - $this->_testAttributes($expected_attributes, $mapping); + $this->testAttributes($expected_attributes, $mapping); } /** * Test attribute creation for mappings which override human-readable content. */ - function testDatatypeCallback() { + public function testDatatypeCallback() { $properties = array('dc:created'); $datatype = 'xsd:dateTime'; @@ -81,14 +84,14 @@ function testDatatypeCallback() { 'content' => $iso_date, ); - $this->_testAttributes($expected_attributes, $mapping, $date); + $this->testAttributes($expected_attributes, $mapping, $date); } /** * Test attribute creation for mappings which use data converters. */ - function testDatatypeCallbackWithConverter() { + public function testDatatypeCallbackWithConverter() { $properties = array('schema:interactionCount'); $data = "23"; @@ -106,13 +109,13 @@ function testDatatypeCallbackWithConverter() { 'content' => $content, ); - $this->_testAttributes($expected_attributes, $mapping, $data); + $this->testAttributes($expected_attributes, $mapping, $data); } /** * Test attribute creation for mappings which use 'rel'. */ - function testRel() { + public function testRel() { $properties = array('sioc:has_creator', 'dc:creator'); $mapping = array( @@ -121,7 +124,7 @@ function testRel() { ); $expected_attributes = array('rel' => $properties); - $this->_testAttributes($expected_attributes, $mapping); + $this->testAttributes($expected_attributes, $mapping); } /** @@ -134,7 +137,7 @@ function testRel() { * @param mixed $data * The data to pass into the datatype callback, if specified. */ - protected function _testAttributes($expected_attributes, $field_mapping, $data = NULL) { + protected function testAttributes($expected_attributes, $field_mapping, $data = NULL) { $mapping = rdf_get_mapping('node', 'article') ->setFieldMapping('field_test', $field_mapping) ->getPreparedFieldMapping('field_test'); diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/StandardProfileTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/StandardProfileTest.php index 5919d54..eb064a6 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/StandardProfileTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/StandardProfileTest.php @@ -99,6 +99,9 @@ class StandardProfileTest extends WebTestBase { */ protected $commenterUri; + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'Standard profile RDF', @@ -107,6 +110,9 @@ public static function getInfo() { ); } + /** + * {@inheritdoc} + */ public function setUp() { parent::setUp(); @@ -158,7 +164,10 @@ public function setUp() { ); $this->article = $this->drupalCreateNode($article_settings); // Create second article to test teaser list. - $this->drupalCreateNode(array('type' => 'article', 'promote' => NODE_PROMOTED,)); + $this->drupalCreateNode(array( + 'type' => 'article', + 'promote' => NODE_PROMOTED, + )); // Create article comment. $this->articleComment = $this->saveComment($this->article->id(), $this->webUser->id(), NULL, 0); @@ -409,7 +418,8 @@ protected function assertRdfaArticleProperties($graph, $message_prefix) { // Tag type. // @todo enable with https://drupal.org/node/2072791 - //$this->assertEqual($graph->type($this->termUri), 'schema:Thing', 'Tag type was found (schema:Thing).'); + // $this->assertEqual($graph->type($this->termUri), 'schema:Thing', + // 'Tag type was found (schema:Thing).'); // Tag name. $expected_value = array( @@ -418,7 +428,9 @@ protected function assertRdfaArticleProperties($graph, $message_prefix) { 'lang' => 'en', ); // @todo enable with https://drupal.org/node/2072791 - //$this->assertTrue($graph->hasProperty($this->termUri, 'http://schema.org/name', $expected_value), "$message_prefix name was found (schema:name)."); + // $this->assertTrue($graph->hasProperty($this->termUri, + // 'http://schema.org/name', $expected_value), + // "$message_prefix name was found (schema:name)."); } /** @@ -460,8 +472,7 @@ protected function assertRdfaNodeCommentProperties($graph) { 'type' => 'literal', // There is an extra carriage return in the when parsing comments as // output by Bartik, so it must be added to the expected value. - 'value' => "$text -", + 'value' => "$text", 'lang' => 'en', ); $this->assertTrue($graph->hasProperty($this->articleCommentUri, 'http://schema.org/text', $expected_value), 'Article comment body was found (schema:text).'); diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/TaxonomyAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/TaxonomyAttributesTest.php index 1172fbc..e182134 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/TaxonomyAttributesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/TaxonomyAttributesTest.php @@ -21,6 +21,9 @@ class TaxonomyAttributesTest extends TaxonomyTestBase { */ public static $modules = array('rdf'); + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'RDFa markup for taxonomy terms', @@ -29,7 +32,10 @@ public static function getInfo() { ); } - function setUp() { + /** + * {@inheritdoc} + */ + public function setUp() { parent::setUp(); $this->vocabulary = $this->createVocabulary(); @@ -46,7 +52,7 @@ function setUp() { /** * Creates a random term and ensures the RDF output is correct. */ - function testTaxonomyTermRdfaAttributes() { + public function testTaxonomyTermRdfaAttributes() { $term = $this->createTerm($this->vocabulary); $term_uri = url('taxonomy/term/' . $term->id(), array('absolute' => TRUE)); diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/TaxonomyTermFieldAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/TaxonomyTermFieldAttributesTest.php index 82b8516..80fef5f 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/TaxonomyTermFieldAttributesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/TaxonomyTermFieldAttributesTest.php @@ -36,6 +36,9 @@ class TaxonomyTermFieldAttributesTest extends TaxonomyTestBase { */ protected $vocabulary; + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'RDFa markup for taxonomy term fields', @@ -44,6 +47,9 @@ public static function getInfo() { ); } + /** + * {@inheritdoc} + */ public function setUp() { parent::setUp(); @@ -77,7 +83,7 @@ public function setUp() { * Ensure that file fields have the correct resource as the object in RDFa * when displayed as a teaser. */ - function testNodeTeaser() { + public function testNodeTeaser() { // Set the teaser display to show this field. entity_get_display('node', 'article', 'teaser') ->setComponent($this->fieldName, array('type' => 'taxonomy_term_reference_link')) @@ -125,23 +131,31 @@ function testNodeTeaser() { 'value' => 'http://www.w3.org/2004/02/skos/core#Concept', ); // @todo enable with https://drupal.org/node/2072791 - //$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).'); + // $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' => $term1->getName(), ); - //$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).'); + // $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).'); // Term 2. $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).'); + // $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' => $term2->getName(), ); - //$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).'); + // $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).'); } /** diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php index fa7f673..2f57e21 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php @@ -23,6 +23,9 @@ class TrackerAttributesTest extends WebTestBase { */ public static $modules = array('rdf', 'tracker'); + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'RDFa markup for tracker page', @@ -31,7 +34,10 @@ public static function getInfo() { ); } - function setUp() { + /** + * {@inheritdoc} + */ + public function setUp() { parent::setUp(); // Creates article content type. @@ -100,7 +106,7 @@ function setUp() { * Creates nodes as both admin and anonymous user and tests for correct RDFa * markup on the tracker page for those nodes and their comments. */ - function testAttributesInTracker() { + public function testAttributesInTracker() { // Creates node as anonymous user. $node_anon = $this->drupalCreateNode(array('type' => 'article', 'uid' => 0)); // Creates node as admin user. @@ -108,8 +114,8 @@ function testAttributesInTracker() { // Passes both the anonymously posted node and the administrator posted node // through to test for the RDF attributes. - $this->_testBasicTrackerRdfaMarkup($node_anon); - $this->_testBasicTrackerRdfaMarkup($node_admin); + $this->testBasicTrackerRdfaMarkup($node_anon); + $this->testBasicTrackerRdfaMarkup($node_admin); } /** @@ -118,9 +124,9 @@ function testAttributesInTracker() { * Tests the tracker page for RDFa markup. * * @param \Drupal\Core\Entity\EntityInterface $node - * The node just created. + * The node just created. */ - function _testBasicTrackerRdfaMarkup(NodeInterface $node) { + public function testBasicTrackerRdfaMarkup(NodeInterface $node) { $node_uri = url('node/' . $node->id(), array('absolute' => TRUE)); $user_uri = url('user/' . $node->getOwnerId(), array('absolute' => TRUE)); @@ -165,13 +171,12 @@ function _testBasicTrackerRdfaMarkup(NodeInterface $node) { ); $this->assertTrue($graph->hasProperty($node_uri, 'http://rdfs.org/sioc/ns#last_activity_date', $expected_value), 'Last activity date found in RDF output (sioc:last_activity_date).'); - // Adds new comment to ensure the tracker is updated accordingly. $comment = array( 'subject' => $this->randomName(), 'comment_body[0][value]' => $this->randomName(), ); - $this->drupalPostForm('comment/reply/node/' . $node->id() .'/comment', $comment, t('Save')); + $this->drupalPostForm('comment/reply/node/' . $node->id() . '/comment', $comment, t('Save')); // Parses tracker page where the nodes are displayed in a table. $parser = new \EasyRdf_Parser_Rdfa(); diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/UserAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/UserAttributesTest.php index 847d893..96ff8b6 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/UserAttributesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/UserAttributesTest.php @@ -21,6 +21,9 @@ class UserAttributesTest extends WebTestBase { */ public static $modules = array('rdf', 'node'); + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'RDFa markup for users', @@ -29,6 +32,9 @@ public static function getInfo() { ); } + /** + * {@inheritdoc} + */ public function setUp() { parent::setUp(); rdf_get_mapping('user', 'user') @@ -47,7 +53,7 @@ public function setUp() { * Creates a random user and ensures the default mapping for the user is * being used. */ - function testUserAttributesInMarkup() { + public function testUserAttributesInMarkup() { // Creates users that should and should not be truncated // by template_preprocess_username (20 characters) // one of these users tests right on the cusp (20). @@ -56,12 +62,12 @@ function testUserAttributesInMarkup() { $authors = array( $this->drupalCreateUser(array(), $this->randomName(30)), $this->drupalCreateUser(array(), $this->randomName(20)), - $this->drupalCreateUser(array(), $this->randomName(5)) + $this->drupalCreateUser(array(), $this->randomName(5)), ); $this->drupalLogin($user1); - foreach($authors as $author) { + foreach ($authors as $author) { $account_uri = url('user/' . $author->id(), array('absolute' => TRUE)); // Parses the user profile page where the default bundle mapping for user diff --git a/core/modules/rdf/rdf.api.php b/core/modules/rdf/rdf.api.php index 4f30732..f811b55 100644 --- a/core/modules/rdf/rdf.api.php +++ b/core/modules/rdf/rdf.api.php @@ -18,7 +18,7 @@ * defined in rdf_rdf_namespaces(), this hook should be used to define the new * namespace prefix. * - * @return + * @return array * An associative array of namespaces where the key is the namespace prefix * and the value is the namespace URI. * diff --git a/core/modules/rdf/tests/Drupal/rdf/Tests/RdfMappingConfigEntityUnitTest.php b/core/modules/rdf/tests/Drupal/rdf/Tests/RdfMappingConfigEntityUnitTest.php index 1572d9c..b364ba7 100644 --- a/core/modules/rdf/tests/Drupal/rdf/Tests/RdfMappingConfigEntityUnitTest.php +++ b/core/modules/rdf/tests/Drupal/rdf/Tests/RdfMappingConfigEntityUnitTest.php @@ -22,14 +22,16 @@ class RdfMappingEntityUnitTest extends UnitTestCase { /** * The entity type used for testing. * - * @var \Drupal\Core\Entity\EntityTypeInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Entity\EntityTypeInterface| + * \PHPUnit_Framework_MockObject_MockObject */ protected $entityType; /** * The entity manager used for testing. * - * @var \Drupal\Core\Entity\EntityManagerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Entity\EntityManagerInterface| + * \PHPUnit_Framework_MockObject_MockObject */ protected $entityManager; @@ -43,7 +45,8 @@ class RdfMappingEntityUnitTest extends UnitTestCase { /** * The UUID generator used for testing. * - * @var \Drupal\Component\Uuid\UuidInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Component\Uuid\UuidInterface| + * \PHPUnit_Framework_MockObject_MockObject */ protected $uuid; @@ -81,6 +84,8 @@ public function setUp() { } /** + * {@inheritdoc} + * * @covers ::calculateDependencies */ public function testCalculateDependencies() { @@ -111,6 +116,8 @@ public function testCalculateDependencies() { } /** + * {@inheritdoc} + * * @covers ::calculateDependencies */ public function testCalculateDependenciesWithEntityBundle() { diff --git a/core/modules/rdf/tests/drupal-7.rdf.database.php b/core/modules/rdf/tests/drupal-7.rdf.database.php index aa0a9f9..7635c42 100644 --- a/core/modules/rdf/tests/drupal-7.rdf.database.php +++ b/core/modules/rdf/tests/drupal-7.rdf.database.php @@ -28,7 +28,7 @@ )) ->values(array( 'type' => 'node', - 'bundle'=> 'rev_test', + 'bundle' => 'rev_test', 'mapping' => serialize($rev_mapping), )) ->execute(); @@ -43,7 +43,7 @@ db_update('rdf_mapping') ->fields(array( 'type' => 'node', - 'bundle'=> 'article', + 'bundle' => 'article', 'mapping' => serialize($altered_mapping), )) ->condition('type', 'node')