I use NetBeans. Configured PHPUnit and got it working. When I create a Test out of existing class "UsersDAO.php" using Nestbeans's special menu options for creating Tests then Netbeans generates Test class and methods and when I Run the Test on UsersDAO.php then everything works ok. Test methods execute and I have the report. When I write test code and play with $this->assertNotEquals() some tests fails some tests pass. Everything is working.
My problem is that I created a new Test class not using Netbeans options to Generate test methods. Placed this new class in same Tests folder where other Test classes are located but when I run this class the tests methods are not called! Why? I get a waring message that
"No tests found in class "InviteUsersTest".

Code: Select all
<?php
ini_set("include_path", "../db".PATH_SEPARATOR."../../db".PATH_SEPARATOR.ini_get("include_path"));
require_once 'PHPUnit/Framework.php';
require_once 'C:\phpprojects\InviteUsersToValidate\db\UserDAO.php';
require_once 'C:\phpprojects\InviteUsersToValidate\db\UserVO.php';
class InviteUsersTest extends PHPUnit_Framework_TestCase
{
public function getNotValidatedUsers()
{
$dao = new UserDAO();
$dao->openConnection();
$records = $dao->getNotValidatedUsers();
$this->assertNotNull($records);
$countRecords = count($records);
$this->assertNotEquals(0, $countRecords);
$dao->closeConnection();
}
}
?>