microdata-parser/tests/MicrodataTest.php
Yusuf Kandemir b5377c04c5 Changed test names with more reasonable ones
These names helps understand purpose of the tests. Also --testdox-html option of phpunit generates more logical results that way.
2018-11-12 19:23:35 +03:00

37 lines
1.0 KiB
PHP

<?php
namespace YusufKandemir\MicrodataParser\Tests;
use YusufKandemir\MicrodataParser\Microdata;
use YusufKandemir\MicrodataParser\MicrodataParser;
class MicrodataTest extends \PHPUnit\Framework\TestCase
{
protected $htmlFileName = __DIR__ . '/data/W3C/source.html';
public function testItCreatesMicrodataParserFromHtml()
{
$html = file_get_contents($this->htmlFileName);
$microdata = Microdata::fromHTML($html);
$this->assertInstanceOf(MicrodataParser::class, $microdata);
}
public function testItCreatesMicrodataParserFromHtmlFile()
{
$microdata = Microdata::fromHTMLFile($this->htmlFileName);
$this->assertInstanceOf(MicrodataParser::class, $microdata);
}
public function testItCreatesMicrodataParserFromDomDocument()
{
$dom = new \DOMDocument;
$dom->loadHTMLFile($this->htmlFileName);
$microdata = Microdata::fromDOMDocument($dom);
$this->assertInstanceOf(MicrodataParser::class, $microdata);
}
}