Projet

Général

Profil

Révision b4adf10d

Ajouté par Assos Assos il y a plus de 9 ans

Udpate to 7.33

Voir les différences:

drupal7/modules/rdf/rdf.test
301 301

  
302 302
    // Ensure the default bundle mapping for node is used. These attributes come
303 303
    // from the node default bundle definition.
304
    $blog_title = $this->xpath("//meta[@property='dc:title' and @content='$node->title']");
304
    $blog_title = $this->xpath("//div[@about='$url']/span[@property='dc:title' and @content='$node->title']");
305 305
    $blog_meta = $this->xpath("//div[(@about='$url') and (@typeof='sioct:Weblog')]//span[contains(@property, 'dc:date') and contains(@property, 'dc:created') and @datatype='xsd:dateTime' and @content='$isoDate']");
306 306
    $this->assertTrue(!empty($blog_title), 'Property dc:title is present in meta tag.');
307 307
    $this->assertTrue(!empty($blog_meta), 'RDF type is present on post. Properties dc:date and dc:created are present on post date.');
......
324 324
    $this->drupalGet('node/' . $node->nid);
325 325

  
326 326
    // Ensure the mapping defined in rdf_module.test is used.
327
    $test_bundle_title = $this->xpath('//meta[@property="dc:title" and @content="' . $node->title . '"]');
327
    $test_bundle_title = $this->xpath("//div[@about='$url']/span[@property='dc:title' and @content=\"$node->title\"]");
328 328
    $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']");
329 329
    $this->assertTrue(!empty($test_bundle_title), 'Property dc:title is present in meta tag.');
330 330
    $this->assertTrue(!empty($test_bundle_meta), 'RDF type is present on post. Properties dc:date and dc:created are present on post date.');
......
343 343

  
344 344
    // Ensure the default bundle mapping for node is used. These attributes come
345 345
    // from the node default bundle definition.
346
    $random_bundle_title = $this->xpath("//meta[@property='dc:title' and @content='$node->title']");
346
    $random_bundle_title = $this->xpath("//div[@about='$url']/span[@property='dc:title' and @content='$node->title']");
347 347
    $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']");
348 348
    $this->assertTrue(!empty($random_bundle_title), 'Property dc:title is present in meta tag.');
349 349
    $this->assertTrue(!empty($random_bundle_meta), 'RDF type is present on post. Properties dc:date and dc:created are present on post date.');
......
461 461

  
462 462
    // Tests number of comments in teaser view.
463 463
    $this->drupalGet('node');
464
    $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"]');
464
    $node_url = url('node/' . $this->node1->nid);
465
    $comment_count_teaser = $this->xpath('//div[@about=:node-url]/span[@property="sioc:num_replies" and @content="2" and @datatype="xsd:integer"]', array(':node-url' => $node_url));
465 466
    $this->assertTrue(!empty($comment_count_teaser), 'RDFa markup for the number of comments found on teaser view.');
466
    $comment_count_link = $this->xpath('//div[@about=:url]//a[contains(@property, "sioc:num_replies") and @rel=""]', array(':url' => url("node/{$this->node1->nid}")));
467
    $this->assertTrue(!empty($comment_count_link), 'Empty rel attribute found in comment count link.');
468 467

  
469 468
    // Tests number of comments in full node view.
470 469
    $this->drupalGet('node/' . $this->node1->nid);
471
    $node_url = url('node/' . $this->node1->nid);
472
    $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));
470
    $comment_count_teaser = $this->xpath('//div[@about=:node-url]/span[@property="sioc:num_replies" and @content="2" and @datatype="xsd:integer"]', array(':node-url' => $node_url));
473 471
    $this->assertTrue(!empty($comment_count_teaser), 'RDFa markup for the number of comments found on full node view.');
474 472
  }
475 473

  

Formats disponibles : Unified diff