Netbeans-PHPUnit “No tests executed” error

痴心易碎 提交于 2019-12-04 05:29:17

Solved by adding below line to Calculatortest.php file.

require_once dirname(__FILE__) . '/../Calculator.php';

The test class is placed in a subdirectory, so I needed to declare the path relative to the Calculator.php.

Also, I had to change php.ini file so that errors are displayed in case there are.
I set following variables in php.ini.

error_reporting  =  E_ALL | E_STRICT
display_errors = On
user3388664

I had suffered the same problem. However, perseverance paid.

1) Create the sample project using NB samples.

2) The directory structure should be:

  • Source Files
    • Calculato.php
  • Test Files
  • Include Path

3) Right click on Calculator.php and choose Tools > Create Tests

4) Add require_once '../src/Calculator.php'; immediately after the top <?php

5) Select Calculator.php and select Test

It worked for me. Let me know if it works for you. I hope, your configuration is ok.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!