I have a class I want to unit test:
<?php namespace App\Http;
use Validator;
class Foo() {}
This class uses the Validator class to check data consistency, etc.
This is my test class:
<?php
use App\Http\Foo as Foo;
class FooTest extends \Codeception\TestCase\Test {}
When I run my test I can instantiate Foo but the Validator class cannot be found:
Fatal error: Class 'Validator' not found in...
How do I get the test to "see" the Validator class? I have tried several things including a require_once, use statements, and changing namespaces, but nothing seems to work.
Fixed it. I extended Laravel's TestCase class instead:
class FooTest extends TestCase