Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove arguments from data provider methods #147

Merged
merged 1 commit into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/SVNBuddy/Config/AbstractConfigSettingTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}
Expand Down Expand Up @@ -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.');
}
Expand All @@ -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.');
}
Expand Down
24 changes: 12 additions & 12 deletions tests/SVNBuddy/Config/ArrayConfigSettingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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),
Expand All @@ -95,21 +95,21 @@ 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)),
'array as string' => array($default_value . PHP_EOL . $stored_value, array($default_value, $stored_value)),
);
}

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),
Expand Down
18 changes: 9 additions & 9 deletions tests/SVNBuddy/Config/ChoiceConfigSettingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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),
Expand Down
18 changes: 9 additions & 9 deletions tests/SVNBuddy/Config/IntegerConfigSettingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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),
Expand Down
18 changes: 9 additions & 9 deletions tests/SVNBuddy/Config/StringConfigSettingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion tests/SVNBuddy/Repository/Connector/ConnectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Loading