Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/CoreAdminHome/tests/Unit/SetConfig/ConfigSettingManipulationTest.php')
-rw-r--r--plugins/CoreAdminHome/tests/Unit/SetConfig/ConfigSettingManipulationTest.php21
1 files changed, 10 insertions, 11 deletions
diff --git a/plugins/CoreAdminHome/tests/Unit/SetConfig/ConfigSettingManipulationTest.php b/plugins/CoreAdminHome/tests/Unit/SetConfig/ConfigSettingManipulationTest.php
index c50178cc11..b382ec39d8 100644
--- a/plugins/CoreAdminHome/tests/Unit/SetConfig/ConfigSettingManipulationTest.php
+++ b/plugins/CoreAdminHome/tests/Unit/SetConfig/ConfigSettingManipulationTest.php
@@ -51,7 +51,7 @@ class ConfigSettingManipulationTest extends \PHPUnit\Framework\TestCase
*/
private $mockConfig;
- protected function setUp()
+ public function setUp(): void
{
$this->mockConfig = new DumbMockConfig();
$this->mockConfigData = array();
@@ -94,11 +94,12 @@ class ConfigSettingManipulationTest extends \PHPUnit\Framework\TestCase
/**
* @dataProvider getFailureTestDataForMake
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage Invalid assignment string
*/
public function test_make_ThrowsWhenInvalidAssignmentStringSupplied($assignmentString)
{
+ $this->expectException(\InvalidArgumentException::class);
+ $this->expectExceptionMessage('Invalid assignment string');
+
ConfigSettingManipulation::make($assignmentString);
}
@@ -113,24 +114,22 @@ class ConfigSettingManipulationTest extends \PHPUnit\Framework\TestCase
);
}
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage Trying to append to non-array setting value
- */
public function test_manipulate_ThrowsIfAppendingNonArraySetting()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Trying to append to non-array setting value');
+
$this->mockConfig->mockConfigData['General']['config'] = "5";
$manipulation = new ConfigSettingManipulation("General", "config", "10", true);
$manipulation->manipulate($this->mockConfig);
}
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage Trying to set non-array value to array setting
- */
public function test_manipulate_ThrowsIfAssigningNonArrayValue_ToArraySetting()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Trying to set non-array value to array setting');
+
$this->mockConfig->mockConfigData['General']['config'] = array("5");
$manipulation = new ConfigSettingManipulation("General", "config", "10", false);