浏览代码

Merge branch 'hotfix/v8-3169-tests' into develop

Olivier Massot 3 年之前
父节点
当前提交
1a621f57e8

+ 4 - 3
tests/Service/Dolibarr/DolibarrSyncServiceTest.php

@@ -46,7 +46,6 @@ class TestableDolibarrSyncService extends DolibarrSyncService {
     public function getPersonContact(Person $person): ?ContactPoint { return parent::getPersonContact($person); }
     public function formatContactPosition(array $missions, ?string $gender = 'X'): string { return parent::formatContactPosition($missions, $gender); }
     public static function formatPhoneNumber(PhoneNumber $phoneNumber): string { return parent::formatPhoneNumber($phoneNumber); }
-    public static function getChanges(array $initialData, array $newData): array { return parent::getChanges($initialData, $newData); }
 }
 
 class DolibarrSyncServiceTest extends TestCase
@@ -98,7 +97,7 @@ class DolibarrSyncServiceTest extends TestCase
     }
 
     private function getJsonContentFromFixture(string $filename): array {
-        $filepath = dirname(__FILE__) . '/fixtures/' . $filename;
+        $filepath = __DIR__ . '/fixtures/' . $filename;
         return json_decode(file_get_contents($filepath), true);
     }
 
@@ -262,6 +261,7 @@ class DolibarrSyncServiceTest extends TestCase
                 ['STUDENTS_COUNT', [], null, null, "Nombre d'élèves"],
                 ['ADHERENTS_COUNT', [], null, null, "Nombre d'adhérents"],
                 ['ADMIN_ACCESS_COUNT', [], null, null, "Nombre d'accès admin"],
+                ['school', [], null, null, "Opentalent School"],
             ]
         );
 
@@ -270,7 +270,6 @@ class DolibarrSyncServiceTest extends TestCase
         $operations = $syncService->scan();
 
         $this->assertCount(4, $operations);
-
         $this->assertEquals(
             [
                 '[PUT thirdparties/1726]',
@@ -280,7 +279,9 @@ class DolibarrSyncServiceTest extends TestCase
                 'email : `` => `email@email.com`',
                 'phone : `+33678403010` => `+33102030405`',
                 'parent : `` => `711`',
+                "array_options.options_2iopen_software_opentalent : `` => `Opentalent School`",
                 "array_options.options_2iopeninfoopentalent : `` => `Nombre d'élèves : 1\nNombre d'adhérents : 3\nNombre d'accès admin : 1`"
+
             ],
             $operations[0]->getChangeLog()
         );

+ 1 - 0
tests/Service/Dolibarr/fixtures/thirdparty.json

@@ -90,6 +90,7 @@
       "options_2iopen_domain": "7",
       "options_2iopen_structure_type": "12",
       "options_2iopen_nombre_eleves": null,
+      "options_2iopen_software_opentalent": null,
       "options_2iopen_software_used": "4",
       "options_2iopen_num_portable": null,
       "options_2iopen_structure_type_cmf": null,