These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Kunstmaan\TranslatorBundle\Tests\Service\Migrations; |
||
4 | |||
5 | use Kunstmaan\TranslatorBundle\Service\Migrations\MigrationsService; |
||
6 | use Kunstmaan\TranslatorBundle\Tests\unit\WebTestCase; |
||
7 | |||
8 | class MigrationsServiceTest extends WebTestCase |
||
9 | { |
||
10 | private $migrationsService; |
||
11 | |||
12 | View Code Duplication | public function setUp() |
|
13 | { |
||
14 | static::bootKernel(['test_case' => 'TranslatorBundleTest', 'root_config' => 'config.yaml']); |
||
15 | $container = static::$kernel->getContainer(); |
||
16 | static::loadFixtures($container); |
||
0 ignored issues
–
show
|
|||
17 | |||
18 | /* @var MigrationsService migrationsService */ |
||
19 | $this->migrationsService = $container->get('kunstmaan_translator.service.migrations.migrations'); |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * @group migrations |
||
24 | */ |
||
25 | public function testGetDiffSqlArray() |
||
26 | { |
||
27 | $result = $this->migrationsService->getDiffSqlArray(); |
||
28 | $this->assertGreaterThanOrEqual(1, count($result)); |
||
29 | $this->assertStringStartsWith('INSERT INTO "kuma_translation"', $result[0]); |
||
30 | } |
||
31 | } |
||
32 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: