Skip to content

Commit d2f6572

Browse files
committed
Added a test for itemid and content attributes
1 parent f763ad5 commit d2f6572

3 files changed

Lines changed: 32 additions & 0 deletions

File tree

tests/MicrodataParserTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ public function data()
9696
'Object & Data tags' => [
9797
$this->getTestData('Object & Data', 'source.html', 'result.json')
9898
],
99+
'Itemid & Content attributes' => [
100+
$this->getTestData('Itemid & Content', 'source.html', 'result.json')
101+
],
99102
];
100103
}
101104

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"items": [
3+
{
4+
"id": "urn:isbn:0-330-34032-8",
5+
"type": [ "https://vocab.example.net/book" ],
6+
"properties": {
7+
"title": [ "The Reality Dysfunction" ],
8+
"author": [ "Peter F. Hamilton" ],
9+
"date": [ "1996-01-26" ],
10+
"publisher": [ "Macmillan Publishers Limited" ]
11+
}
12+
}
13+
]
14+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!-- URI: http://books.example.com/the-reality-dysfunction/ -->
2+
<!DOCTYPE HTML>
3+
<html>
4+
<head>
5+
<title>The Reality Dysfunction</title>
6+
</head>
7+
<body>
8+
<div itemscope itemtype="https://vocab.example.net/book" itemid="urn:isbn:0-330-34032-8">
9+
<div>Title: <span itemprop="title">The Reality Dysfunction</span></div>
10+
<div>Author: <span itemprop="author">Peter F. Hamilton</span></div>
11+
<div>Publication date: <time itemprop="date" datetime="1996-01-26">26 January 1996</time></div>
12+
<meta itemprop="publisher" content="Macmillan Publishers Limited">
13+
</div>
14+
</body>
15+
</html>

0 commit comments

Comments
 (0)