This commit is contained in:
2022-10-05 15:23:28 +02:00
parent 58b1778544
commit a967e1ed17
194 changed files with 1580 additions and 1386 deletions

View File

@@ -1,5 +1,14 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Services\Import;
use Chill\MainBundle\Service\Import\GeographicalUnitBaseImporter;
@@ -8,7 +17,11 @@ use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\NullLogger;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
class GeographicalUnitBaseImporterTest extends KernelTestCase
/**
* @internal
* @coversNothing
*/
final class GeographicalUnitBaseImporterTest extends KernelTestCase
{
private Connection $connection;
@@ -42,10 +55,10 @@ class GeographicalUnitBaseImporterTest extends KernelTestCase
$importer->finalize();
$unit = $this->connection->executeQuery("
$unit = $this->connection->executeQuery('
SELECT unitname, unitrefid, cmgul.refid AS layerrefid, cmgul.name AS layername, ST_AsText(ST_snapToGrid(ST_Transform(u.geom, 3812), 1)) AS geom
FROM chill_main_geographical_unit u JOIN chill_main_geographical_unit_layer cmgul on u.layer_id = cmgul.id
WHERE u.unitrefid = ?", ['layer_one']);
FROM chill_main_geographical_unit u JOIN chill_main_geographical_unit_layer cmgul on u.layer_id = cmgul.id
WHERE u.unitrefid = ?', ['layer_one']);
$results = $unit->fetchAssociative();
@@ -71,10 +84,10 @@ class GeographicalUnitBaseImporterTest extends KernelTestCase
$importer->finalize();
$unit = $this->connection->executeQuery("
$unit = $this->connection->executeQuery('
SELECT unitname, unitrefid, cmgul.refid AS layerrefid, cmgul.name AS layername, ST_AsText(ST_snapToGrid(ST_Transform(u.geom, 3812), 1)) AS geom
FROM chill_main_geographical_unit u JOIN chill_main_geographical_unit_layer cmgul on u.layer_id = cmgul.id
WHERE u.unitrefid = ?", ['layer_one']);
FROM chill_main_geographical_unit u JOIN chill_main_geographical_unit_layer cmgul on u.layer_id = cmgul.id
WHERE u.unitrefid = ?', ['layer_one']);
$results = $unit->fetchAssociative();
@@ -83,7 +96,5 @@ class GeographicalUnitBaseImporterTest extends KernelTestCase
$this->assertEquals(json_decode($results['layername'], true), ['fr' => 'Test Layer fixed']);
$this->assertEquals($results['layerrefid'], 'test');
$this->assertEquals($results['geom'], 'MULTIPOLYGON(((130 120,45 40,10 40,130 120)),((0 0,15 5,40 10,10 20,0 0)))');
}
}
}