File tree Expand file tree Collapse file tree 3 files changed +2568
-3
lines changed
lizmap/modules/lizmap/lib/Project/Qgis
tests/units/classes/Project Expand file tree Collapse file tree 3 files changed +2568
-3
lines changed Original file line number Diff line number Diff line change 2222 * @property string $version
2323 * @property string $projectname
2424 * @property string $title
25- * @property null| string $saveDateTime
26- * @property null| string $saveUser
27- * @property null| string $saveUserFull
25+ * @property string $saveDateTime
26+ * @property string $saveUser
27+ * @property string $saveUserFull
2828 * @property SpatialRefSys $projectCrs
2929 * @property ProjectProperties $properties
3030 * @property LayerTreeRoot $layerTreeRoot
Original file line number Diff line number Diff line change @@ -262,4 +262,23 @@ public function testJsonEncode(): void
262262 $ this ->assertNotNull ($ json );
263263 $ this ->assertStringStartsWith ('{"version": ' , $ json );
264264 }
265+
266+ public function testProjetWithMissingProjetInfo (): void
267+ {
268+ $ xml_path_invalid = __DIR__ .'/../../Project/Ressources/project_empty_qgis_tag.qgs ' ;
269+
270+ $ oXml = App \XmlTools::xmlReaderFromFile ($ xml_path_invalid );
271+ $ project = Qgis \ProjectInfo::fromXmlReader ($ oXml );
272+ // missing values on XML will be empty string
273+ $ emptyProps = array (
274+ 'version ' ,
275+ 'projectname ' ,
276+ 'saveDateTime ' ,
277+ 'saveUser ' ,
278+ 'saveUserFull ' ,
279+ );
280+ foreach ($ emptyProps as $ prop ) {
281+ $ this ->assertEmpty ($ project ->{$ prop });
282+ }
283+ }
265284}
You can’t perform that action at this time.
0 commit comments