dquv73115 2017-01-26 17:37
浏览 84
已采纳

Net Beans 8和PHPUnit-Skeleton-Generator

This question is geared towards anyone using Net Beans 8, or any newer version, and PHPUnit. I'm a little confused by which direction to go in and am wondering if anyone who has already done this can point me in the best direction.

I have setup PHPUnit and PHPUnit-Skeleton-Generator in my Net Beans 8.2 installation. I ran the demo in their documents and everything works as it is supposed to.

The demo from the Net Beans document creates a simple calculator class to add two numbers. You use the @assert notation in block quotes above the class with two values to be added and the expected result. The PHPUnit-Skeleton-Generator reads each @assert and creates a test script using PHPUnit for testing. All works as planned.

My next step was to find other more complicated examples to learn from. In that research, I find that PHPUnit-Skeleton-Generator is deprecated and the assert methods are different in PHPUnit.

My dilemma is, do I continue using it as Net Beans designed it with PHPUnit-Skeleton-Generator and @assert notation, or do I just manually write my tests based on the documentation on PHPUnit's website?

I know most will say to use the PHPUnit docs, and I can't say I disagree. However, I want to still see the results in Net Beans GUI per their documentation. If I ditch the Skeleton and manually write my tesets, will I still be able to use the Net Beans integration to run and utilize the tests?

If I must still use the Skeleton to be able to use the Net Bean integration, is there a good resource to learn how to use the skeleton? Are there other types of @asserts

  • 写回答

1条回答 默认 最新

  • dongsisui7562 2017-01-27 05:41
    关注

    You surely can just write your tests and run them via NetBeans gui and watch results in it as well. Just don't forget to configure you testing preferences and options in Project properties => Testing => PHPUnit

    enter image description here

    If you don't need any special settings you can just choose to run all *Test.php files in testing directory (shown at screenshot).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵