当前位置: 首页 > news >正文

网络营销推广方法包括有哪些?沈阳seo合作

网络营销推广方法包括有哪些?,沈阳seo合作,南京淄博网站建设工作室,下载百度官方网站【题记:最近进行了ExcelBDD PHP版的开发,查阅了大量资料,发现PHP测试覆盖率解决方案存在不同的历史版本,让我花费了蛮多时间,为了避免后人浪费时间,整理本文,而且网上没有给出Azure DevOps里面P…

【题记:最近进行了ExcelBDD PHP版的开发,查阅了大量资料,发现PHP测试覆盖率解决方案存在不同的历史版本,让我花费了蛮多时间,为了避免后人浪费时间,整理本文,而且网上没有给出Azure DevOps里面PHP测试覆盖率的解决方案,本文一并给出】

版本

  • PHP 8.2.12
  • PHPUnit 10.4.2
  • php-code-coverage 10.1.7

  • Xdebug v3.3.0alpha3
  • 操作系统:Win11

安装

  1. 分别安装PHP, Composer(见 Composer)
  2. 安装PHPUnit,php-code-coverage
  3. 根据网上指南配置PHPUnit,比如PHPUnit 手册 – 第 1 章 安装 PHPUnit
  4. 下载Xdebug,见Xdebug: Downloads
  5. 配置php.ini 在尾部加如下 
[Xdebug]
zend_extension="D:\php\php_xdebug-3.3.0alpha3-8.2-vs16-x86_64.dll"
xdebug.mode=coverage

其中zend_extension是Xdebug的绝对路径

配置

PHPUnit前后版本在phpunit.xml上历经了多次修改,网上能够查到的都是旧版,浪费了我好多时间。如下是最新格式。

<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php"xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd"cacheDirectory="testReports/.phpunit.cache"><source><include><directory suffix=".php">src</directory></include></source><coverage><report><cobertura outputFile="testReports/cobertura.xml" /></report></coverage><logging><junit outputFile="testReports/junit.xml" /></logging></phpunit>

网上容易查到的“filter”,“whitelist”已经过时。PHPUnit作者考虑到前后变化,提供了自动改写功能,如下:

phpunit --migrate-configuration

目前PHPUnit支持的覆盖率格式如下

<report><clover outputFile="clover.xml"/><cobertura outputFile="cobertura.xml"/><crap4j outputFile="crap4j.xml" threshold="50"/><html outputDirectory="html-coverage" lowUpperBound="50" highLowerBound="90"/><php outputFile="coverage.php"/><text outputFile="coverage.txt" showUncoveredFiles="false" showOnlySummary="true"/><xml outputDirectory="xml-coverage"/>
</report>

参见 5. The XML Configuration File — PHPUnit 10.4 Manual

测试结果所有选项如下

<logging><junit outputFile="junit.xml"/><teamcity outputFile="teamcity.txt"/><testdoxHtml outputFile="testdox.html"/><testdoxText outputFile="testdox.txt"/>
</logging>

Azure DevOps Pipelines的配置

微软官方没有给出PHP测试覆盖率解决方案,经过摸索,得到如下方案:

在azure-pipelines.yml对应位置,按下修改来准备好环境

- script: |sudo update-alternatives --set php /usr/bin/php$(phpVersion)sudo update-alternatives --set phar /usr/bin/phar$(phpVersion)sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpVersion)sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion)sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion)
# 如下这行没有必要,azure的VM已经安装了xdebugsudo apt-get install php8.1-xdebug
# 下行必需,php.ini的位置可以通过 php -i 得到sudo sh -c "echo 'xdebug.mode=coverage' >> /etc/php/8.1/cli/php.ini"php -versiondisplayName: 'Use PHP version $(phpVersion)'

发布测试结果

- task: PublishTestResults@2inputs:testRunner: "JUnit"# Make sure the file name matches the file name you specified.testResultsFiles: "**/testReports/junit.xml"failTaskOnFailedTests: truedisplayName: "Publish Test Results"

发布测试覆盖率

- task: PublishCodeCoverageResults@1inputs:codeCoverageTool: CoberturasummaryFileLocation: '**/testReports/cobertura.xml'

提示:PublishCodeCoverageResults@2达到的效果不如PublishCodeCoverageResults@1。

ExcelBDD PHP版在Azure DevOps配置了CI,见ExcelBDD PHP CI

全部文件见ExcelBDD开源项目PHP部分

http://www.15wanjia.com/news/33876.html

相关文章:

  • 网站做虚假广告b2b平台营销
  • 微信h5页面制作免费巢湖seo推广
  • 网站制作公司 首推万维科技发布推广信息的网站
  • 怎么设计一个网站深圳网络推广网络
  • 渭南建网站企业查询宝
  • 邓州网站设计重庆百度推广
  • 网站模板与网站开发网站优化塔山双喜
  • 赤峰政府门户网站建设相关制度百度推广seo怎么学
  • wordpress程序代码搜索引擎优化的主要内容
  • 建筑英才招聘网首页百度搜索引擎优化的方法
  • qq空间 同步 wordpressseo扣费系统源码
  • 黄石做网站联系百度收录排名
  • 四川成都私人网站建设电子商务网站建设规划方案
  • 邯郸网站建设效果大数据查询平台
  • wordpress 网站名称乐云seo
  • 企业做网站的流程window优化大师官网
  • 那个网站可以找人做兼职软文营销平台
  • 汩罗网站建设如何快速推广自己的网站
  • wordpress 360加速seo推广费用
  • 做网站找哪家最好seo优化软件哪个好
  • 我想在阿里巴巴上给别人做网站网站标题优化排名
  • 网站在线支付接口怎么推广app让人去下载
  • 酒店平台网站建设seo优化便宜
  • 完整的app网站开发凡科建站多少钱
  • p2p网贷网站建设哪家好兰州seo整站优化服务商
  • 电子商城网站开发软件网络促销的方法有哪些
  • b站炮姐国内最新的新闻
  • 建立b2b企业网站石家庄seo扣费
  • 吉林省住房城乡建设厅网站首页比较火的推广软件
  • 贵阳做网站公司排名上海最新发布