Closed wellbornman closed 3 years ago
Hi @wellbornman , which class are you extending in your test class?
I see TestCase
, but in which namespace this class are?
Closing due to no response. Feel free to re-open or comment if you are still having issues.
namespace Tests;
use App\User;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase{
.....
}
@wellbornman can you try to extend Cviebrock\LaravelElasticsearch\Tests\TestCase
in your test class instead Illuminate\Foundation\Testing\TestCase as BaseTestCase
I used "Elasticsearch" with static method "search", (Elasticsearch::search()) in my model and used my model's methods many times in my controller, and everything works fine, Model\Example.php
Controller\ExampleController.php
but when I use same code I wrote in my controller in my test classes, I encounter this error: Error: Class 'Elasticsearch' not found,
whats is the problem?