|
2 | 2 |
|
3 | 3 | namespace App\Tests\Controller; |
4 | 4 |
|
5 | | -use App\Core\Traits\JwtTrait; |
6 | 5 | use App\Manager\AppUserManager; |
7 | 6 | use App\Manager\CallManager; |
8 | 7 | use App\Manager\ElasticsearchClusterManager; |
|
11 | 10 | use App\Model\CallRequestModel; |
12 | 11 | use Symfony\Bundle\FrameworkBundle\KernelBrowser; |
13 | 12 | use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; |
14 | | -use Symfony\Component\BrowserKit\Cookie; |
15 | | -use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; |
16 | 13 |
|
17 | 14 | abstract class AbstractAppControllerTest extends WebTestCase |
18 | 15 | { |
@@ -49,15 +46,25 @@ protected function setUp(): void |
49 | 46 | { |
50 | 47 | $this->client = static::createClient([], ['HTTPS' => true]); |
51 | 48 |
|
52 | | - $this->callManager = static::getContainer()->get('App\Manager\CallManager'); |
53 | | - |
54 | | - $this->appUserManager = static::getContainer()->get('App\Manager\AppUserManager'); |
| 49 | + $callManager = static::getContainer()->get('App\Manager\CallManager'); |
| 50 | + if ($callManager instanceof CallManager) { |
| 51 | + $this->callManager = $callManager; |
| 52 | + } |
55 | 53 |
|
56 | | - $this->elasticsearchClusterManager = static::getContainer()->get('App\Manager\ElasticsearchClusterManager'); |
| 54 | + $appUserManager = static::getContainer()->get('App\Manager\AppUserManager'); |
| 55 | + if ($appUserManager instanceof AppUserManager) { |
| 56 | + $this->appUserManager = $appUserManager; |
| 57 | + } |
57 | 58 |
|
58 | | - $this->elasticsearchNodeManager = static::getContainer()->get('App\Manager\ElasticsearchNodeManager'); |
| 59 | + $elasticsearchClusterManager = static::getContainer()->get('App\Manager\ElasticsearchClusterManager'); |
| 60 | + if ($elasticsearchClusterManager instanceof ElasticsearchClusterManager) { |
| 61 | + $this->elasticsearchClusterManager = $elasticsearchClusterManager; |
| 62 | + } |
59 | 63 |
|
60 | | - $firewallName = 'main'; |
| 64 | + $elasticsearchNodeManager = static::getContainer()->get('App\Manager\ElasticsearchNodeManager'); |
| 65 | + if ($elasticsearchNodeManager instanceof ElasticsearchNodeManager) { |
| 66 | + $this->elasticsearchNodeManager = $elasticsearchNodeManager; |
| 67 | + } |
61 | 68 |
|
62 | 69 | $query = [ |
63 | 70 | 'q' => 'email:"example@example.com"', |
|
0 commit comments