comparison core/modules/rdf/tests/src/Kernel/RdfaAttributesTest.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
55 public function testDatatypeCallback() { 55 public function testDatatypeCallback() {
56 $properties = ['dc:created']; 56 $properties = ['dc:created'];
57 $datatype = 'xsd:dateTime'; 57 $datatype = 'xsd:dateTime';
58 58
59 $date = 1252750327; 59 $date = 1252750327;
60 $iso_date = date('c', $date); 60 $iso_date = $this->container->get('date.formatter')->format($date, 'custom', 'c', 'UTC');
61 61
62 $mapping = [ 62 $mapping = [
63 'datatype' => $datatype, 63 'datatype' => $datatype,
64 'properties' => $properties, 64 'properties' => $properties,
65 'datatype_callback' => ['callable' => 'date_iso8601'], 65 'datatype_callback' => ['callable' => 'Drupal\rdf\CommonDataConverter::dateIso8601Value'],
66 ]; 66 ];
67 $expected_attributes = [ 67 $expected_attributes = [
68 'datatype' => $datatype, 68 'datatype' => $datatype,
69 'property' => $properties, 69 'property' => $properties,
70 'content' => $iso_date, 70 'content' => $iso_date,
71 ]; 71 ];
72 72
73 $this->_testAttributes($expected_attributes, $mapping, $date); 73 $this->_testAttributes($expected_attributes, $mapping, ['value' => $date]);
74 } 74 }
75 75
76 /** 76 /**
77 * Test attribute creation for mappings which use data converters. 77 * Test attribute creation for mappings which use data converters.
78 */ 78 */