From 7e3027ec40044672259857c6986fc09ae0b3fb34 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 31 Mar 2024 12:06:23 +0300 Subject: [PATCH] Remove arguments from data provider methods --- .../Config/AbstractConfigSettingTestCase.php | 6 ++--- .../Config/ArrayConfigSettingTest.php | 24 +++++++++---------- .../Config/ChoiceConfigSettingTest.php | 18 +++++++------- .../Config/IntegerConfigSettingTest.php | 18 +++++++------- .../Config/StringConfigSettingTest.php | 18 +++++++------- .../Repository/Connector/ConnectorTest.php | 2 +- 6 files changed, 43 insertions(+), 43 deletions(-) diff --git a/tests/SVNBuddy/Config/AbstractConfigSettingTestCase.php b/tests/SVNBuddy/Config/AbstractConfigSettingTestCase.php index ad0b107..76d3124 100644 --- a/tests/SVNBuddy/Config/AbstractConfigSettingTestCase.php +++ b/tests/SVNBuddy/Config/AbstractConfigSettingTestCase.php @@ -294,7 +294,7 @@ public function testSetValueNormalization($value, $normalized_value) $this->assertSame($normalized_value, $config_setting->getValue()); } - public static function normalizationValueDataProvider($test_name, $value = null, $normalized_value = null) + public static function normalizationValueDataProvider() { throw new \RuntimeException('Override me.'); } @@ -334,7 +334,7 @@ public function testSetValueWithInheritanceFromDefault($wc_value, $global_value) $this->assertNull($this->configEditor->get('global-settings.name'), 'Inherited value isn\'t stored'); } - public static function setValueWithInheritanceDataProvider($test_name, $wc_value = null, $global_value = null) + public static function setValueWithInheritanceDataProvider() { throw new \RuntimeException('Override me.'); } @@ -350,7 +350,7 @@ public function testStorage($user_value, $stored_value) $this->assertSame($stored_value, $this->configEditor->get('global-settings.name')); } - public static function storageDataProvider($test_name, $default_value = null, $stored_value = null) + public static function storageDataProvider() { throw new \RuntimeException('Override me.'); } diff --git a/tests/SVNBuddy/Config/ArrayConfigSettingTest.php b/tests/SVNBuddy/Config/ArrayConfigSettingTest.php index 3c71bfe..9da277c 100644 --- a/tests/SVNBuddy/Config/ArrayConfigSettingTest.php +++ b/tests/SVNBuddy/Config/ArrayConfigSettingTest.php @@ -34,10 +34,10 @@ protected function setupTest() parent::setupTest(); } - public static function normalizationValueDataProvider($test_name, $value = array('a'), $normalized_value = array('b')) + public static function normalizationValueDataProvider() { - $value = static::getSampleValue($value, true); - $normalized_value = static::getSampleValue($normalized_value, true); + $value = static::getSampleValue(array('a'), true); + $normalized_value = static::getSampleValue(array('b'), true); return array( 'empty array' => array( @@ -75,10 +75,10 @@ public static function normalizationValueDataProvider($test_name, $value = array ); } - public static function setValueWithInheritanceDataProvider($test_name, $wc_value = array('global_value'), $global_value = array('default')) + public static function setValueWithInheritanceDataProvider() { - $wc_value = static::getSampleValue($wc_value); - $global_value = static::getSampleValue($global_value); + $wc_value = static::getSampleValue(array('global_value')); + $global_value = static::getSampleValue(array('default')); return array( array($wc_value, $global_value), @@ -95,10 +95,10 @@ public function testDefaultValueIsConvertedToScalar($default_value, $user_value) $this->assertSame($user_value, $config_setting->getValue(AbstractConfigSetting::SCOPE_GLOBAL)); } - public static function defaultValueIsConvertedToScalarDataProvider($test_name, $default_value = array('a'), $stored_value = array('b')) + public static function defaultValueIsConvertedToScalarDataProvider() { - $default_value = static::getSampleValue($default_value, true); - $stored_value = static::getSampleValue($stored_value, true); + $default_value = static::getSampleValue(array('a'), true); + $stored_value = static::getSampleValue(array('b'), true); return array( 'array into string' => array(array($default_value, $stored_value), array($default_value, $stored_value)), @@ -106,10 +106,10 @@ public static function defaultValueIsConvertedToScalarDataProvider($test_name, $ ); } - public static function storageDataProvider($test_name, $default_value = array('a'), $stored_value = array('b')) + public static function storageDataProvider() { - $default_value = static::getSampleValue($default_value, true); - $stored_value = static::getSampleValue($stored_value, true); + $default_value = static::getSampleValue(array('a'), true); + $stored_value = static::getSampleValue(array('b'), true); return array( 'array into string' => array(array($default_value, $stored_value), $default_value . PHP_EOL . $stored_value), diff --git a/tests/SVNBuddy/Config/ChoiceConfigSettingTest.php b/tests/SVNBuddy/Config/ChoiceConfigSettingTest.php index 1ce91b6..d222542 100644 --- a/tests/SVNBuddy/Config/ChoiceConfigSettingTest.php +++ b/tests/SVNBuddy/Config/ChoiceConfigSettingTest.php @@ -34,10 +34,10 @@ protected function setupTest() parent::setupTest(); } - public static function normalizationValueDataProvider($test_name, $value = 1, $normalized_value = 1) + public static function normalizationValueDataProvider() { - $value = static::getSampleValue($value, true); - $normalized_value = static::getSampleValue($normalized_value, true); + $value = static::getSampleValue(1, true); + $normalized_value = static::getSampleValue(1, true); return array( 'as is' => array( @@ -56,20 +56,20 @@ public function testSetValueUnknownChoice() $config_setting->setValue(5); } - public static function setValueWithInheritanceDataProvider($test_name, $wc_value = 2, $global_value = 1) + public static function setValueWithInheritanceDataProvider() { - $wc_value = static::getSampleValue($wc_value, true); - $global_value = static::getSampleValue($global_value, true); + $wc_value = static::getSampleValue(2, true); + $global_value = static::getSampleValue(1, true); return array( array($wc_value, $global_value), ); } - public static function storageDataProvider($test_name, $default_value = 1, $stored_value = 1) + public static function storageDataProvider() { - $default_value = static::getSampleValue($default_value, true); - $stored_value = static::getSampleValue($stored_value, true); + $default_value = static::getSampleValue(1, true); + $stored_value = static::getSampleValue(1, true); return array( 'as is' => array($default_value, $stored_value), diff --git a/tests/SVNBuddy/Config/IntegerConfigSettingTest.php b/tests/SVNBuddy/Config/IntegerConfigSettingTest.php index 2d82953..3ed344f 100644 --- a/tests/SVNBuddy/Config/IntegerConfigSettingTest.php +++ b/tests/SVNBuddy/Config/IntegerConfigSettingTest.php @@ -34,10 +34,10 @@ protected function setupTest() parent::setupTest(); } - public static function normalizationValueDataProvider($test_name, $value = 1, $normalized_value = 0) + public static function normalizationValueDataProvider() { - $value = static::getSampleValue($value, true); - $normalized_value = static::getSampleValue($normalized_value, true); + $value = static::getSampleValue(1, true); + $normalized_value = static::getSampleValue(0, true); return array( 'integer' => array( @@ -91,20 +91,20 @@ public static function sampleArrayDataProvider() ); } - public static function setValueWithInheritanceDataProvider($test_name, $wc_value = 2, $global_value = 1) + public static function setValueWithInheritanceDataProvider() { - $wc_value = static::getSampleValue($wc_value, true); - $global_value = static::getSampleValue($global_value, true); + $wc_value = static::getSampleValue(2, true); + $global_value = static::getSampleValue(1, true); return array( array($wc_value, $global_value), ); } - public static function storageDataProvider($test_name, $default_value = 1, $stored_value = 1) + public static function storageDataProvider() { - $default_value = static::getSampleValue($default_value, true); - $stored_value = static::getSampleValue($stored_value, true); + $default_value = static::getSampleValue(1, true); + $stored_value = static::getSampleValue(1, true); return array( 'integer' => array($default_value, $default_value), diff --git a/tests/SVNBuddy/Config/StringConfigSettingTest.php b/tests/SVNBuddy/Config/StringConfigSettingTest.php index 1460b52..b58e910 100644 --- a/tests/SVNBuddy/Config/StringConfigSettingTest.php +++ b/tests/SVNBuddy/Config/StringConfigSettingTest.php @@ -34,10 +34,10 @@ protected function setupTest() parent::setupTest(); } - public static function normalizationValueDataProvider($test_name, $value = 'a', $normalized_value = 'b') + public static function normalizationValueDataProvider() { - $value = static::getSampleValue($value, true); - $normalized_value = static::getSampleValue($normalized_value, true); + $value = static::getSampleValue('a', true); + $normalized_value = static::getSampleValue('b', true); return array( 'empty string' => array( @@ -83,20 +83,20 @@ public static function sampleArrayDataProvider() ); } - public static function setValueWithInheritanceDataProvider($test_name, $wc_value = 'global_value', $global_value = 'default') + public static function setValueWithInheritanceDataProvider() { - $wc_value = static::getSampleValue($wc_value, true); - $global_value = static::getSampleValue($global_value, true); + $wc_value = static::getSampleValue('global_value', true); + $global_value = static::getSampleValue('default', true); return array( array($wc_value, $global_value), ); } - public static function storageDataProvider($test_name, $default_value = 'a', $stored_value = 'b') + public static function storageDataProvider() { - $default_value = static::getSampleValue($default_value, true); - $stored_value = static::getSampleValue($stored_value, true); + $default_value = static::getSampleValue('a', true); + $stored_value = static::getSampleValue('b', true); return array( 'string' => array($default_value, $default_value), diff --git a/tests/SVNBuddy/Repository/Connector/ConnectorTest.php b/tests/SVNBuddy/Repository/Connector/ConnectorTest.php index 2734c9d..73428c0 100644 --- a/tests/SVNBuddy/Repository/Connector/ConnectorTest.php +++ b/tests/SVNBuddy/Repository/Connector/ConnectorTest.php @@ -196,7 +196,7 @@ public function testGetWorkingCopyUrlFromPath($raw_command_output, $path, $url) $this->assertEquals($url, $actual); } - public function svnInfoDataProvider() + public static function svnInfoDataProvider() { return array( 'svn1.6_wc_root_with_peg' => array(self::getFixture('svn_info_peg_16.xml'), '/path/to/working-c@py', self::DUMMY_REPO),