I am trying to create my first unit test. I use Zend Studio, and I have added the phpUnit library to my project by going to:
Project -> Properties -> Add Library
When I run it as PHP Unit Test I get the following error:
Unable to run a PHPUnit session. Only PHPUNIT classes can be run as PHPUnit tests. Reason: Not tests found in IndexControllerTest.php
IndexControllerTest.php:
<?php
require_once 'application\controllers\IndexController.php';
require_once 'PHPUnit\Framework\TestCase.php';
/**
* IndexController test case.
*/
class IndexControllerTest extends PHPUnit_Framework_TestCase
{
/**
* @var IndexController
*/
private $IndexController;
/**
* Prepares the environment before running a test.
*/
protected function setUp ()
{
parent::setUp();
// TODO Auto-generated IndexControllerTest::setUp()
$this->IndexController = new IndexController(/* parameters */);
}
/**
* Cleans up the environment after running a test.
*/
protected function tearDown ()
{
// TODO Auto-generated IndexControllerTest::tearDown()
$this->IndexController = null;
parent::tearDown();
}
/**
* Constructs the test case.
*/
public function __construct ()
{
// TODO Auto-generated constructor
}
/**
* Tests IndexController->init()
*/
public function testInit ()
{
// TODO Auto-generated IndexControllerTest->testInit()
$this->markTestIncomplete("init test not implemented");
$this->IndexController->init(/* parameters */);
}
/**
* Tests IndexController->indexAction()
*/
public function testIndexAction ()
{
// TODO Auto-generated IndexControllerTest->testIndexAction()
$this->markTestIncomplete("indexAction test not implemented");
$this->IndexController->indexAction(/* parameters */);
}
}
How do I fix that?