phpunit/phpunit-dom-assertions 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

phpunit/phpunit-dom-assertions

最新稳定版本:v3.7.0

Composer 安装命令:

composer require phpunit/phpunit-dom-assertions

包简介

DOM assertions for PHPUnit

README 文档

README

Latest Stable Version Downloads Integrate

A work in progress, drop-in replacement for the following deprecated PHPUnit assertions:

  • assertSelectCount()
  • assertSelectRegExp()
  • assertXPathCount()
  • assertXPathEquals()
  • assertXPathSelectRegExp()
  • assertSelectEquals()

Installation

$ composer require --dev phpunit/phpunit-dom-assertions

Usage

Extend PHPUnit\Framework\DOMTestCase to use the DOM assertions:

namespace My\Tests;

use PHPUnit\Framework\DOMAssert;
use PHPUnit\Framework\TestCase;

final class DOMTest extends TestCase
{
    public function testSelectEquals(): void
    {
        $html = file_get_contents('test.html');
        $selector = 'span.test_class';
        $content  = 'Test Class Text';

        DOMAssert::assertSelectEquals($selector, $content, true, $html);
    }
}

License

The PHPUnit DOM assertions library is licensed under the BSD 3-Clause license.

统计信息

  • 总下载量: 323.84k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 29
  • 点击次数: 1
  • 依赖项目数: 12
  • 推荐数: 0

GitHub 信息

  • Stars: 29
  • Watchers: 5
  • Forks: 13
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-08-27