I keep getting this error in my command line on phpStorm when I try use phpunit. Can someone explain this to me? I'm new to phpunit.
C:\xampp\php\phpunit.bat
Warning: Missing argument 3 for PHPUnit_TextUI_TestRunner::doRun(), called in C:\xampp\php\pear\PHPUnit\TextUI\Command.php on line 176 and defined in C:\xampp\htdocs\tutorials\php_unit_testing\vendor\phpunit\phpunit\src\TextUI\TestRunner.php on line 148
PHPUnit 5.3-dev by Sebastian Bergmann and contributors.
Fatal error: Class 'controllers\core\web\Pages' not found in C:\xampp\htdocs\tutorials\php_unit_testing\tests\app\controllers\core\web\PagesTest.php on line 6
Process finished with exit code 255 at 22:23:20. Execution time: 186 ms.
Here is a my code from my xml file:
<?xml version='1.0' encoding='UTF-8' ?>
<phpunit bootstrap="./vendor/autoload.php"
color="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailures="false"
syntaxCheck="false"
>
<testsuites>
<testsuite name="Tutorial Unit Tests">
<directory>./tests/</directory>
</testsuite>
</testsuites>
</phpunit>
And this is the code from pages.php:
<?php
namespace controllers\core\web;
class Pages{
public function rendor(){
return 'Hello World';
}
public function return_true(){
return true;
}
public function return_array(){
return array('Hello', 'world', 'This', 'is', 'an', 'array');
}
}
?>
And this is the code from PagesTest.php:
<?php
class PagesTest extends PHPUnit_Framework_TestCase
{
public function testRenderReturnsHelloWorld(){
$pages = new \controllers\core\web\Pages();
$expected = 'Hello Word';
$this->assertEquals($expected, $pages->rendor());
}
}
?>