I have
Error: Class 'app\Main' not found
And I don`t know how to fix it?
I use PHPSTORM and phpunit latest version.
Main.php
<?php
namespace app;
class Main
{
public function Calc()
{
return 1;
}
}
MainTest.php
<?php
namespace app;
use PHPUnit\Framework\TestCase;
class MainTest extends TestCase
{
public function testCalc()
{
$a = new Main();
}
}
phpunit.xml:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit verbose="true">
<testsuites>
<testsuite name="My Test Suite">
<directory suffix="Test.php" phpVersion="5.3.0" phpVersionOperator=">=">tests</directory>
<!-- <file phpVersion="5.3.0" phpVersionOperator=">=">/path/to/MyTest.php</file>-->
</testsuite>
</testsuites>
</phpunit>
composer.json
{
"autoload": {
"classmap": [
"src/"
]
},
"require": {
"phpunit/phpunit": "7.0.1"
}
}