Skip to content

Commit

Permalink
[unit-test] force object type in lizmapServices
Browse files Browse the repository at this point in the history
  • Loading branch information
nworr committed Feb 16, 2023
1 parent 54ffb97 commit 86f8e4d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/units/classes/Project/ProjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function testGetRelativeQgisPath($relative, $root, $file, $expectedPath)
array('services' =>
array('relativeWMSPath' => $relative,
'rootRepositories' => $root)
), null, false, null, null);
), (object) array(), false, null, null);
$proj = new ProjectForTests();
$proj->setRepo(new Project\Repository(null, array('path' => ''), null, null, null));
$proj->setServices($services);
Expand Down
6 changes: 3 additions & 3 deletions tests/units/classes/lizmapServicesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public function getModifyLocalData()
*/
public function testModifyLocal($localConfig, $newConfig, $changedProperty, $changedValue, $expectedReturnValue)
{
$testLizmapServices = new LizmapServices($localConfig, null, false, '', null);
$testLizmapServices = new LizmapServices($localConfig, (object) array(), false, '', null);
$this->assertEquals($expectedReturnValue, $testLizmapServices->modify($newConfig));
if (isset($changedProperty)) {
$this->assertEquals($changedValue, $testLizmapServices->{$changedProperty});
Expand Down Expand Up @@ -436,8 +436,8 @@ public function getMetricsEnabled()
public function testGetMetricsEnabled($testValue, $expectedValue)
{
$ini_tab = array('hideSensitiveServicesProperties' => '0',
'services' => array(
'appName' => 'Lizmap' ),
'services' => array(
'appName' => 'Lizmap', ),
);

if ($testValue !== null) {
Expand Down
2 changes: 1 addition & 1 deletion tests/units/testslib/QgisProjectForTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class QgisProjectForTests extends QgisProject
public function __construct($data = null)
{
if ($data) {
parent::__construct(null, new lizmapServices(null, null, false, '', ''), new ContextForTests(), $data);
parent::__construct(null, new lizmapServices(null, (object) array(), false, '', ''), new ContextForTests(), $data);
}
}

Expand Down

0 comments on commit 86f8e4d

Please sign in to comment.