diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php index bb712b6..342c28e 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php @@ -67,15 +67,15 @@ class CommentAttributesTest extends CommentTestBase { // Tests number of comments in teaser view. $this->drupalGet('node'); $comment_count_teaser = $this->xpath('//div[contains(@typeof, "sioc:Item")]//li[contains(@class, "comment-comments")]/a[contains(@property, "sioc:num_replies") and contains(@content, "2") and @datatype="xsd:integer"]'); - $this->assertTrue(!empty($comment_count_teaser), t('RDFa markup for the number of comments found on teaser view.')); + $this->assertTrue(!empty($comment_count_teaser), 'RDFa markup for the number of comments found on teaser view.'); $comment_count_link = $this->xpath('//div[@about=:url]//a[contains(@property, "sioc:num_replies") and @rel=""]', array(':url' => url("node/{$this->node1->nid}"))); - $this->assertTrue(!empty($comment_count_link), t('Empty rel attribute found in comment count link.')); + $this->assertTrue(!empty($comment_count_link), 'Empty rel attribute found in comment count link.'); // Tests number of comments in full node view. $this->drupalGet('node/' . $this->node1->nid); $node_url = url('node/' . $this->node1->nid); $comment_count_teaser = $this->xpath('/html/head/meta[@about=:node-url and @property="sioc:num_replies" and @content="2" and @datatype="xsd:integer"]', array(':node-url' => $node_url)); - $this->assertTrue(!empty($comment_count_teaser), t('RDFa markup for the number of comments found on full node view.')); + $this->assertTrue(!empty($comment_count_teaser), 'RDFa markup for the number of comments found on full node view.'); } /** @@ -115,10 +115,10 @@ class CommentAttributesTest extends CommentTestBase { $this->_testBasicCommentRdfaMarkup($comment2, $anonymous_user); // Tests the RDFa markup for the homepage (specific to anonymous comments). $comment_homepage = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/a[contains(@class, "username") and @typeof="sioc:UserAccount" and @property="foaf:name" and @href="http://example.org/" and contains(@rel, "foaf:page")]'); - $this->assertTrue(!empty($comment_homepage), t('RDFa markup for the homepage of anonymous user found.')); + $this->assertTrue(!empty($comment_homepage), 'RDFa markup for the homepage of anonymous user found.'); // There should be no about attribute on anonymous comments. $comment_homepage = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/a[@about]'); - $this->assertTrue(empty($comment_homepage), t('No about attribute is present on anonymous user comment.')); + $this->assertTrue(empty($comment_homepage), 'No about attribute is present on anonymous user comment.'); // Tests comment #2 as logged in user. $this->drupalLogin($this->web_user); @@ -126,10 +126,10 @@ class CommentAttributesTest extends CommentTestBase { $this->_testBasicCommentRdfaMarkup($comment2, $anonymous_user); // Tests the RDFa markup for the homepage (specific to anonymous comments). $comment_homepage = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/a[contains(@class, "username") and @typeof="sioc:UserAccount" and @property="foaf:name" and @href="http://example.org/" and contains(@rel, "foaf:page")]'); - $this->assertTrue(!empty($comment_homepage), t("RDFa markup for the homepage of anonymous user found.")); + $this->assertTrue(!empty($comment_homepage), "RDFa markup for the homepage of anonymous user found."); // There should be no about attribute on anonymous comments. $comment_homepage = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/a[@about]'); - $this->assertTrue(empty($comment_homepage), t("No about attribute is present on anonymous user comment.")); + $this->assertTrue(empty($comment_homepage), "No about attribute is present on anonymous user comment."); } /** @@ -142,9 +142,9 @@ class CommentAttributesTest extends CommentTestBase { // Tests the reply_of relationship of a first level comment. $result = $this->xpath("(id('comments')//div[contains(@class,'comment ')])[position()=1]//span[@rel='sioc:reply_of' and @resource=:node]", array(':node' => url("node/{$this->node1->nid}"))); - $this->assertEqual(1, count($result), t('RDFa markup referring to the node is present.')); + $this->assertEqual(1, count($result), 'RDFa markup referring to the node is present.'); $result = $this->xpath("(id('comments')//div[contains(@class,'comment ')])[position()=1]//span[@rel='sioc:reply_of' and @resource=:comment]", array(':comment' => url('comment/1#comment-1'))); - $this->assertFalse($result, t('No RDFa markup referring to the comment itself is present.')); + $this->assertFalse($result, 'No RDFa markup referring to the comment itself is present.'); // Posts a reply to the first comment. $this->drupalGet('comment/reply/' . $this->node1->nid . '/' . $comments[0]->id); @@ -152,9 +152,9 @@ class CommentAttributesTest extends CommentTestBase { // Tests the reply_of relationship of a second level comment. $result = $this->xpath("(id('comments')//div[contains(@class,'comment ')])[position()=2]//span[@rel='sioc:reply_of' and @resource=:node]", array(':node' => url("node/{$this->node1->nid}"))); - $this->assertEqual(1, count($result), t('RDFa markup referring to the node is present.')); + $this->assertEqual(1, count($result), 'RDFa markup referring to the node is present.'); $result = $this->xpath("(id('comments')//div[contains(@class,'comment ')])[position()=2]//span[@rel='sioc:reply_of' and @resource=:comment]", array(':comment' => url('comment/1', array('fragment' => 'comment-1')))); - $this->assertEqual(1, count($result), t('RDFa markup referring to the parent comment is present.')); + $this->assertEqual(1, count($result), 'RDFa markup referring to the parent comment is present.'); $comments = $this->xpath("(id('comments')//div[contains(@class,'comment ')])[position()=2]"); } @@ -170,16 +170,16 @@ class CommentAttributesTest extends CommentTestBase { */ function _testBasicCommentRdfaMarkup($comment, $account = array()) { $comment_container = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]'); - $this->assertTrue(!empty($comment_container), t("Comment RDF type for comment found.")); + $this->assertTrue(!empty($comment_container), 'Comment RDF type for comment found.'); $comment_title = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//h3[@property="dc:title"]'); - $this->assertEqual((string)$comment_title[0]->a, $comment->subject, t("RDFa markup for the comment title found.")); + $this->assertEqual((string) $comment_title[0]->a, $comment->subject, 'RDFa markup for the comment title found.'); $comment_date = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//*[contains(@property, "dc:date") and contains(@property, "dc:created")]'); - $this->assertTrue(!empty($comment_date), t("RDFa markup for the date of the comment found.")); + $this->assertTrue(!empty($comment_date), 'RDFa markup for the date of the comment found.'); // The author tag can be either a or span $comment_author = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/*[contains(@class, "username") and @typeof="sioc:UserAccount" and @property="foaf:name"]'); $name = empty($account["name"]) ? $this->web_user->name : $account["name"] . " (not verified)"; - $this->assertEqual((string)$comment_author[0], $name, t("RDFa markup for the comment author found.")); + $this->assertEqual((string) $comment_author[0], $name, 'RDFa markup for the comment author found.'); $comment_body = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//div[@class="content"]//div[contains(@class, "comment-body")]//div[@property="content:encoded"]'); - $this->assertEqual((string)$comment_body[0]->p, $comment->comment, t("RDFa markup for the comment body found.")); + $this->assertEqual((string) $comment_body[0]->p, $comment->comment, 'RDFa markup for the comment body found.'); } } diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/CrudTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/CrudTest.php index 3e52bd9..3383f94 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/CrudTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/CrudTest.php @@ -35,7 +35,7 @@ class CrudTest extends WebTestBase { function testCRUD() { // Verify loading of a default mapping. $mapping = _rdf_mapping_load('test_entity', 'test_bundle'); - $this->assertTrue(count($mapping), t('Default mapping was found.')); + $this->assertTrue(count($mapping), 'Default mapping was found.'); // Verify saving a mapping. $mapping = array( @@ -52,34 +52,34 @@ class CrudTest extends WebTestBase { ), ), ); - $this->assertTrue(rdf_mapping_save($mapping) === SAVED_NEW, t('Mapping was saved.')); + $this->assertTrue(rdf_mapping_save($mapping) === SAVED_NEW, 'Mapping was saved.'); // Read the raw record from the {rdf_mapping} table. $result = db_query('SELECT * FROM {rdf_mapping} WHERE type = :type AND bundle = :bundle', array(':type' => $mapping['type'], ':bundle' => $mapping['bundle'])); $stored_mapping = $result->fetchAssoc(); $stored_mapping['mapping'] = unserialize($stored_mapping['mapping']); - $this->assertEqual($mapping, $stored_mapping, t('Mapping was stored properly in the {rdf_mapping} table.')); + $this->assertEqual($mapping, $stored_mapping, 'Mapping was stored properly in the {rdf_mapping} table.'); // Verify loading of saved mapping. - $this->assertEqual($mapping['mapping'], _rdf_mapping_load($mapping['type'], $mapping['bundle']), t('Saved mapping loaded successfully.')); + $this->assertEqual($mapping['mapping'], _rdf_mapping_load($mapping['type'], $mapping['bundle']), 'Saved mapping loaded successfully.'); // Verify updating of mapping. $mapping['mapping']['title'] = array( 'predicates' => array('dc2:bar2'), ); - $this->assertTrue(rdf_mapping_save($mapping) === SAVED_UPDATED, t('Mapping was updated.')); + $this->assertTrue(rdf_mapping_save($mapping) === SAVED_UPDATED, 'Mapping was updated.'); // Read the raw record from the {rdf_mapping} table. $result = db_query('SELECT * FROM {rdf_mapping} WHERE type = :type AND bundle = :bundle', array(':type' => $mapping['type'], ':bundle' => $mapping['bundle'])); $stored_mapping = $result->fetchAssoc(); $stored_mapping['mapping'] = unserialize($stored_mapping['mapping']); - $this->assertEqual($mapping, $stored_mapping, t('Updated mapping was stored properly in the {rdf_mapping} table.')); + $this->assertEqual($mapping, $stored_mapping, 'Updated mapping was stored properly in the {rdf_mapping} table.'); // Verify loading of saved mapping. - $this->assertEqual($mapping['mapping'], _rdf_mapping_load($mapping['type'], $mapping['bundle']), t('Saved mapping loaded successfully.')); + $this->assertEqual($mapping['mapping'], _rdf_mapping_load($mapping['type'], $mapping['bundle']), 'Saved mapping loaded successfully.'); // Verify deleting of mapping. - $this->assertTrue(rdf_mapping_delete($mapping['type'], $mapping['bundle']), t('Mapping was deleted.')); - $this->assertFalse(_rdf_mapping_load($mapping['type'], $mapping['bundle']), t('Deleted mapping is no longer found in the database.')); + $this->assertTrue(rdf_mapping_delete($mapping['type'], $mapping['bundle']), 'Mapping was deleted.'); + $this->assertFalse(_rdf_mapping_load($mapping['type'], $mapping['bundle']), 'Deleted mapping is no longer found in the database.'); } } diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/GetNamespacesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/GetNamespacesTest.php index 36a2885..4a68e52 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/GetNamespacesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/GetNamespacesTest.php @@ -39,21 +39,21 @@ class GetNamespacesTest extends WebTestBase { $element = $this->xpath('//html[contains(@prefix, :prefix_binding)]', array( ':prefix_binding' => 'rdfs: http://www.w3.org/2000/01/rdf-schema#', )); - $this->assertTrue(!empty($element), t('A prefix declared once is displayed.')); + $this->assertTrue(!empty($element), 'A prefix declared once is displayed.'); $element = $this->xpath('//html[contains(@prefix, :prefix_binding)]', array( ':prefix_binding' => 'foaf: http://xmlns.com/foaf/0.1/', )); - $this->assertTrue(!empty($element), t('The same prefix declared in several implementations of hook_rdf_namespaces() is valid as long as all the namespaces are the same.')); + $this->assertTrue(!empty($element), 'The same prefix declared in several implementations of hook_rdf_namespaces() is valid as long as all the namespaces are the same.'); $element = $this->xpath('//html[contains(@prefix, :prefix_binding)]', array( ':prefix_binding' => 'foaf1: http://xmlns.com/foaf/0.1/', )); - $this->assertTrue(!empty($element), t('Two prefixes can be assigned the same namespace.')); + $this->assertTrue(!empty($element), 'Two prefixes can be assigned the same namespace.'); $element = $this->xpath('//html[contains(@prefix, :prefix_binding)]', array( ':prefix_binding' => 'dc: ', )); - $this->assertTrue(empty($element), t('A prefix with conflicting namespaces is discarded.')); + $this->assertTrue(empty($element), 'A prefix with conflicting namespaces is discarded.'); } } diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php index bc78fc2..997e41a 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php @@ -36,9 +36,9 @@ class GetRdfNamespacesTest extends WebTestBase { // Get all RDF namespaces. $ns = rdf_get_namespaces(); - $this->assertEqual($ns['rdfs'], 'http://www.w3.org/2000/01/rdf-schema#', t('A prefix declared once is included.')); - $this->assertEqual($ns['foaf'], 'http://xmlns.com/foaf/0.1/', t('The same prefix declared in several implementations of hook_rdf_namespaces() is valid as long as all the namespaces are the same.')); - $this->assertEqual($ns['foaf1'], 'http://xmlns.com/foaf/0.1/', t('Two prefixes can be assigned the same namespace.')); - $this->assertTrue(!isset($ns['dc']), t('A prefix with conflicting namespaces is discarded.')); + $this->assertEqual($ns['rdfs'], 'http://www.w3.org/2000/01/rdf-schema#', 'A prefix declared once is included.'); + $this->assertEqual($ns['foaf'], 'http://xmlns.com/foaf/0.1/', 'The same prefix declared in several implementations of hook_rdf_namespaces() is valid as long as all the namespaces are the same.'); + $this->assertEqual($ns['foaf1'], 'http://xmlns.com/foaf/0.1/', 'Two prefixes can be assigned the same namespace.'); + $this->assertTrue(!isset($ns['dc']), 'A prefix with conflicting namespaces is discarded.'); } } diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/MappingDefinitionTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/MappingDefinitionTest.php index 9db4a00..ab7fb0d 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/MappingDefinitionTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/MappingDefinitionTest.php @@ -45,8 +45,8 @@ class MappingDefinitionTest extends TaxonomyTestBase { // from the node default bundle definition. $node_title = $this->xpath("//meta[@property='dc:title' and @content='$node->title']"); $node_meta = $this->xpath("//div[(@about='$url')]//span[contains(@property, 'dc:date') and contains(@property, 'dc:created') and @datatype='xsd:dateTime' and @content='$isoDate']"); - $this->assertTrue(!empty($node_title), t('Property dc:title is present in meta tag.')); - $this->assertTrue(!empty($node_meta), t('RDF type is present on post. Properties dc:date and dc:created are present on post date.')); + $this->assertTrue(!empty($node_title), 'Property dc:title is present in meta tag.'); + $this->assertTrue(!empty($node_meta), 'RDF type is present on post. Properties dc:date and dc:created are present on post date.'); } /** @@ -65,8 +65,8 @@ class MappingDefinitionTest extends TaxonomyTestBase { // Ensure the mapping defined in rdf_module.test is used. $test_bundle_title = $this->xpath("//meta[@property='dc:title' and @content='$node->title']"); $test_bundle_meta = $this->xpath("//div[(@about='$url') and contains(@typeof, 'foo:mapping_install1') and contains(@typeof, 'bar:mapping_install2')]//span[contains(@property, 'dc:date') and contains(@property, 'dc:created') and @datatype='xsd:dateTime' and @content='$isoDate']"); - $this->assertTrue(!empty($test_bundle_title), t('Property dc:title is present in meta tag.')); - $this->assertTrue(!empty($test_bundle_meta), t('RDF type is present on post. Properties dc:date and dc:created are present on post date.')); + $this->assertTrue(!empty($test_bundle_title), 'Property dc:title is present in meta tag.'); + $this->assertTrue(!empty($test_bundle_meta), 'RDF type is present on post. Properties dc:date and dc:created are present on post date.'); } /** @@ -86,8 +86,8 @@ class MappingDefinitionTest extends TaxonomyTestBase { // from the node default bundle definition. $random_bundle_title = $this->xpath("//meta[@property='dc:title' and @content='$node->title']"); $random_bundle_meta = $this->xpath("//div[(@about='$url') and contains(@typeof, 'sioc:Item') and contains(@typeof, 'foaf:Document')]//span[contains(@property, 'dc:date') and contains(@property, 'dc:created') and @datatype='xsd:dateTime' and @content='$isoDate']"); - $this->assertTrue(!empty($random_bundle_title), t('Property dc:title is present in meta tag.')); - $this->assertTrue(!empty($random_bundle_meta), t('RDF type is present on post. Properties dc:date and dc:created are present on post date.')); + $this->assertTrue(!empty($random_bundle_title), 'Property dc:title is present in meta tag.'); + $this->assertTrue(!empty($random_bundle_meta), 'RDF type is present on post. Properties dc:date and dc:created are present on post date.'); } /** @@ -112,19 +112,19 @@ class MappingDefinitionTest extends TaxonomyTestBase { $user2_profile_about = $this->xpath('//article[@class="profile" and @typeof="sioc:UserAccount" and @about=:account-uri]', array( ':account-uri' => $account_uri, )); - $this->assertTrue(!empty($user2_profile_about), t('RDFa markup found on user profile page')); + $this->assertTrue(!empty($user2_profile_about), 'RDFa markup found on user profile page'); $user_account_holder = $this->xpath('//meta[contains(@typeof, "foaf:Person") and @about=:person-uri and @resource=:account-uri and contains(@rel, "foaf:account")]', array( ':person-uri' => $person_uri, ':account-uri' => $account_uri, )); - $this->assertTrue(!empty($user_account_holder), t('URI created for account holder and username set on sioc:UserAccount.')); + $this->assertTrue(!empty($user_account_holder), 'URI created for account holder and username set on sioc:UserAccount.'); $user_username = $this->xpath('//meta[@about=:account-uri and contains(@property, "foaf:name") and @content=:username]', array( ':account-uri' => $account_uri, ':username' => $username, )); - $this->assertTrue(!empty($user_username), t('foaf:name set on username.')); + $this->assertTrue(!empty($user_username), 'foaf:name set on username.'); // User 2 creates node. $this->drupalLogin($user2); @@ -136,7 +136,7 @@ class MappingDefinitionTest extends TaxonomyTestBase { $author_about = $this->xpath('//a[@typeof="sioc:UserAccount" and @about=:account-uri and @property="foaf:name" and contains(@lang, "")]', array( ':account-uri' => $account_uri, )); - $this->assertTrue(!empty($author_about), t('RDFa markup found on author information on post. The lang attribute on username is set to empty string.')); + $this->assertTrue(!empty($author_about), 'RDFa markup found on author information on post. The lang attribute on username is set to empty string.'); } /** @@ -154,6 +154,6 @@ class MappingDefinitionTest extends TaxonomyTestBase { ':term-url' => $term_url, ':term-label' => $term_label, )); - $this->assertTrue(!empty($term_rdfa_meta), t('RDFa markup found on term page.')); + $this->assertTrue(!empty($term_rdfa_meta), 'RDFa markup found on term page.'); } } diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/MappingHookTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/MappingHookTest.php index e29d545..eb1340e 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/MappingHookTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/MappingHookTest.php @@ -35,16 +35,16 @@ class MappingHookTest extends WebTestBase { function testMapping() { // Test that the mapping is returned correctly by the hook. $mapping = rdf_mapping_load('test_entity', 'test_bundle'); - $this->assertIdentical($mapping['rdftype'], array('sioc:Post'), t('Mapping for rdftype is sioc:Post.')); - $this->assertIdentical($mapping['title'], array('predicates' => array('dc:title')), t('Mapping for title is dc:title.')); + $this->assertIdentical($mapping['rdftype'], array('sioc:Post'), 'Mapping for rdftype is sioc:Post.'); + $this->assertIdentical($mapping['title'], array('predicates' => array('dc:title')), 'Mapping for title is dc:title.'); $this->assertIdentical($mapping['created'], array( 'predicates' => array('dc:created'), 'datatype' => 'xsd:dateTime', 'callback' => 'date_iso8601', - ), t('Mapping for created is dc:created with datatype xsd:dateTime and callback date_iso8601.')); - $this->assertIdentical($mapping['uid'], array('predicates' => array('sioc:has_creator', 'dc:creator'), 'type' => 'rel'), t('Mapping for uid is sioc:has_creator and dc:creator, and type is rel.')); + ), 'Mapping for created is dc:created with datatype xsd:dateTime and callback date_iso8601.'); + $this->assertIdentical($mapping['uid'], array('predicates' => array('sioc:has_creator', 'dc:creator'), 'type' => 'rel'), 'Mapping for uid is sioc:has_creator and dc:creator, and type is rel.'); $mapping = rdf_mapping_load('test_entity', 'test_bundle_no_mapping'); - $this->assertEqual($mapping, array(), t('Empty array returned when an entity type, bundle pair has no mapping.')); + $this->assertEqual($mapping, array(), 'Empty array returned when an entity type, bundle pair has no mapping.'); } } diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/RdfaMarkupTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/RdfaMarkupTest.php index 8c3b398..00e4259 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/RdfaMarkupTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/RdfaMarkupTest.php @@ -158,13 +158,13 @@ class RdfaMarkupTest extends WebTestBase { $file_rel = $this->xpath('//div[contains(@about, :node-uri)]//div[contains(@rel, "rdfs:seeAlso") and contains(@resource, ".txt")]', array( ':node-uri' => 'node/' . $nid, )); - $this->assertTrue(!empty($file_rel), t('Attribute \'rel\' set on file field. Attribute \'resource\' is also set.')); + $this->assertTrue(!empty($file_rel), "Attribute 'rel' set on file field. Attribute 'resource' is also set."); $image_rel = $this->xpath('//div[contains(@about, :node-uri)]//div[contains(@rel, "rdfs:seeAlso") and contains(@resource, :image)]//img[contains(@typeof, "foaf:Image")]', array( ':node-uri' => 'node/' . $nid, ':image' => $image_filename, )); - $this->assertTrue(!empty($image_rel), t('Attribute \'rel\' set on image field. Attribute \'resource\' is also set.')); + $this->assertTrue(!empty($image_rel), "Attribute 'rel' set on image field. Attribute 'resource' is also set."); // Edits the node to add tags. $tag1 = $this->randomName(8); @@ -178,11 +178,11 @@ class RdfaMarkupTest extends WebTestBase { ':node-url' => url('node/' . $node->nid), ':term-name' => $tag1, )); - $this->assertTrue(!empty($term_rdfa_meta), t('Property dc:subject is present for the tag1 field item.')); + $this->assertTrue(!empty($term_rdfa_meta), 'Property dc:subject is present for the tag1 field item.'); $term_rdfa_meta = $this->xpath('//div[@about=:node-url and contains(@typeof, "sioc:Item") and contains(@typeof, "foaf:Document")]//ul[@class="links"]/li[@rel="dc:subject"]/a[@typeof="skos:Concept" and text()=:term-name]', array( ':node-url' => url('node/' . $node->nid), ':term-name' => $tag2, )); - $this->assertTrue(!empty($term_rdfa_meta), t('Property dc:subject is present for the tag2 field item.')); + $this->assertTrue(!empty($term_rdfa_meta), 'Property dc:subject is present for the tag2 field item.'); } } diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php index e4f6fe4..2a8fba3 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php @@ -83,35 +83,35 @@ class TrackerAttributesTest extends WebTestBase { // success of the following tests, but making it explicit will make // debugging easier in case of failure. $tracker_about = $this->xpath('//tr[@about=:url]', array(':url' => $url)); - $this->assertTrue(!empty($tracker_about), t('About attribute found on table row for @user content.', array('@user'=> $user))); + $this->assertTrue(!empty($tracker_about), format_string('About attribute found on table row for @user content.', array('@user'=> $user))); // Tests whether the title has the correct property attribute. $tracker_title = $this->xpath('//tr[@about=:url]/td[@property="dc:title" and @datatype=""]', array(':url' => $url)); - $this->assertTrue(!empty($tracker_title), t('Title property attribute found on @user content.', array('@user'=> $user))); + $this->assertTrue(!empty($tracker_title), format_string('Title property attribute found on @user content.', array('@user'=> $user))); // Tests whether the relationship between the content and user has been set. $tracker_user = $this->xpath('//tr[@about=:url]//td[contains(@rel, "sioc:has_creator")]//*[contains(@typeof, "sioc:UserAccount") and contains(@property, "foaf:name")]', array(':url' => $url)); - $this->assertTrue(!empty($tracker_user), t('Typeof and name property attributes found on @user.', array('@user'=> $user))); + $this->assertTrue(!empty($tracker_user), format_string('Typeof and name property attributes found on @user.', array('@user'=> $user))); // There should be an about attribute on logged in users and no about // attribute for anonymous users. $tracker_user = $this->xpath('//tr[@about=:url]//td[@rel="sioc:has_creator"]/*[@about]', array(':url' => $url)); if ($node->uid == 0) { - $this->assertTrue(empty($tracker_user), t('No about attribute is present on @user.', array('@user'=> $user))); + $this->assertTrue(empty($tracker_user), format_string('No about attribute is present on @user.', array('@user'=> $user))); } elseif ($node->uid > 0) { - $this->assertTrue(!empty($tracker_user), t('About attribute is present on @user.', array('@user'=> $user))); + $this->assertTrue(!empty($tracker_user), format_string('About attribute is present on @user.', array('@user'=> $user))); } // Tests whether the property has been set for number of comments. $tracker_replies = $this->xpath('//tr[@about=:url]//td[contains(@property, "sioc:num_replies") and contains(@content, "0") and @datatype="xsd:integer"]', array(':url' => $url)); - $this->assertTrue($tracker_replies, t('Num replies property and content attributes found on @user content.', array('@user'=> $user))); + $this->assertTrue($tracker_replies, format_string('Num replies property and content attributes found on @user content.', array('@user'=> $user))); // Tests that the appropriate RDFa markup to annotate the latest activity // date has been added to the tracker output before comments have been // posted, meaning the latest activity reflects changes to the node itself. $isoDate = date('c', $node->changed); $tracker_activity = $this->xpath('//tr[@about=:url]//td[contains(@property, "dc:modified") and contains(@property, "sioc:last_activity_date") and contains(@datatype, "xsd:dateTime") and @content=:date]', array(':url' => $url, ':date' => $isoDate)); - $this->assertTrue(!empty($tracker_activity), t('Latest activity date and changed properties found when there are no comments on @user content. Latest activity date content is correct.', array('@user'=> $user))); + $this->assertTrue(!empty($tracker_activity), format_string('Latest activity date and changed properties found when there are no comments on @user content. Latest activity date content is correct.', array('@user'=> $user))); // Tests that the appropriate RDFa markup to annotate the latest activity // date has been added to the tracker output after a comment is posted. @@ -124,7 +124,7 @@ class TrackerAttributesTest extends WebTestBase { // Tests whether the property has been set for number of comments. $tracker_replies = $this->xpath('//tr[@about=:url]//td[contains(@property, "sioc:num_replies") and contains(@content, "1") and @datatype="xsd:integer"]', array(':url' => $url)); - $this->assertTrue($tracker_replies, t('Num replies property and content attributes found on @user content.', array('@user'=> $user))); + $this->assertTrue($tracker_replies, format_string('Num replies property and content attributes found on @user content.', array('@user'=> $user))); // Need to query database directly to obtain last_activity_date because // it cannot be accessed via node_load(). @@ -134,6 +134,6 @@ class TrackerAttributesTest extends WebTestBase { } $isoDate = date('c', $expected_last_activity_date); $tracker_activity = $this->xpath('//tr[@about=:url]//td[@property="sioc:last_activity_date" and @datatype="xsd:dateTime" and @content=:date]', array(':url' => $url, ':date' => $isoDate)); - $this->assertTrue(!empty($tracker_activity), t('Latest activity date found when there are comments on @user content. Latest activity date content is correct.', array('@user'=> $user))); + $this->assertTrue(!empty($tracker_activity), format_string('Latest activity date found when there are comments on @user content. Latest activity date content is correct.', array('@user'=> $user))); } }