123456789101112131415161718192021222324252627282930 |
- <?php
- namespace Faker\Test\Provider;
- use Faker\Generator;
- use Faker\Provider\HtmlLorem;
- use PHPUnit\Framework\TestCase;
- class HtmlLoremTest extends TestCase
- {
- public function testProvider()
- {
- $faker = new Generator();
- $faker->addProvider(new HtmlLorem($faker));
- $node = $faker->randomHtml(6, 10);
- $this->assertStringStartsWith("<html>", $node);
- $this->assertStringEndsWith("</html>\n", $node);
- }
- public function testRandomHtmlReturnsValidHTMLString(){
- $faker = new Generator();
- $faker->addProvider(new HtmlLorem($faker));
- $node = $faker->randomHtml(6, 10);
- $dom = new \DOMDocument();
- $error = $dom->loadHTML($node);
- $this->assertTrue($error);
- }
- }
|