Я пытаюсь создать свой первый модульный тест.Я использую Zend Studio, и я добавил библиотеку phpUnit в свой проект, перейдя по адресу:
Project -> Properties -> Add Library
Когда я запускаю ее как PHP Unit Test, я получаю следующую ошибку:
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 */);
}
}
Как это исправить?