Added a test for itemid and content attributes

This commit is contained in:
Yusuf Kandemir 2018-12-18 11:29:31 +03:00
parent f763ad5b56
commit d2f6572125
3 changed files with 32 additions and 0 deletions

View File

@ -96,6 +96,9 @@ class MicrodataParserTest extends \PHPUnit\Framework\TestCase
'Object & Data tags' => [ 'Object & Data tags' => [
$this->getTestData('Object & Data', 'source.html', 'result.json') $this->getTestData('Object & Data', 'source.html', 'result.json')
], ],
'Itemid & Content attributes' => [
$this->getTestData('Itemid & Content', 'source.html', 'result.json')
],
]; ];
} }

View File

@ -0,0 +1,14 @@
{
"items": [
{
"id": "urn:isbn:0-330-34032-8",
"type": [ "https://vocab.example.net/book" ],
"properties": {
"title": [ "The Reality Dysfunction" ],
"author": [ "Peter F. Hamilton" ],
"date": [ "1996-01-26" ],
"publisher": [ "Macmillan Publishers Limited" ]
}
}
]
}

View File

@ -0,0 +1,15 @@
<!-- URI: http://books.example.com/the-reality-dysfunction/ -->
<!DOCTYPE HTML>
<html>
<head>
<title>The Reality Dysfunction</title>
</head>
<body>
<div itemscope itemtype="https://vocab.example.net/book" itemid="urn:isbn:0-330-34032-8">
<div>Title: <span itemprop="title">The Reality Dysfunction</span></div>
<div>Author: <span itemprop="author">Peter F. Hamilton</span></div>
<div>Publication date: <time itemprop="date" datetime="1996-01-26">26 January 1996</time></div>
<meta itemprop="publisher" content="Macmillan Publishers Limited">
</div>
</body>
</html>