I’m trying to write some unit tests however no matter what I do I keep getting the error ‘Error : Class “pathtoclassclassToTest” not found’.
The test I’m trying to run has a simple structure:
<?php
namespace testsunit;
use pathtoclassclassToTest;
use PHPUnitFrameworkTestCase;
class className extends TestCase
{
public function testname()
{
$classToTest = new classToTest;
$result = $classToTest->test();
$this->assertTrue($result);
}
}
With the classToTest looking like this:
<?php
namespace pathtoclass;
public function test()
{
return true;
}