|
2 | 2 |
|
3 | 3 | namespace Algolia\SearchBundle; |
4 | 4 |
|
5 | | -use Algolia\SearchBundle\Doctrine\NullConnection; |
6 | | -use Algolia\SearchBundle\Engine\AlgoliaEngine; |
7 | | -use Algolia\SearchBundle\Engine\AlgoliaSyncEngine; |
8 | | -use Algolia\SearchBundle\Engine\NullEngine; |
9 | 5 | use Algolia\SearchBundle\Entity\Comment; |
10 | | -use AlgoliaSearch\Client; |
11 | 6 | use Algolia\SearchBundle\Entity\Post; |
12 | 7 | use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; |
13 | | -use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; |
14 | | -use Symfony\Component\Yaml\Yaml; |
15 | 8 |
|
16 | 9 | class BaseTest extends KernelTestCase |
17 | 10 | { |
| 11 | + public static function setUpBeforeClass() |
| 12 | + { |
| 13 | + /* |
| 14 | + * Older version of PHPUnit (<6.0) load |
| 15 | + * env variables differently, we override them |
| 16 | + * here to make sure they're coming from the |
| 17 | + * env rather than the XML config |
| 18 | + */ |
| 19 | + if (class_exists('\PHPUnit_Runner_Version')) { |
| 20 | + $_ENV['ALGOLIA_PREFIX'] = getenv('ALGOLIA_PREFIX'); |
| 21 | + $_ENV['TRAVIS_JOB_NUMBER'] = getenv('TRAVIS_JOB_NUMBER'); |
| 22 | + } |
| 23 | + } |
| 24 | + |
18 | 25 | public function setUp() |
19 | 26 | { |
20 | 27 | $this->bootKernel(); |
@@ -60,7 +67,7 @@ protected function createComment($id = null) |
60 | 67 |
|
61 | 68 | protected function getPrefix() |
62 | 69 | { |
63 | | - return getenv('ALGOLIA_PREFIX'); |
| 70 | + return $this->get('search.index_manager')->getConfiguration()['prefix']; |
64 | 71 | } |
65 | 72 |
|
66 | 73 | protected function get($id) |
|
0 commit comments