Skip to content

Commit

Permalink
Fix problematic data providers
Browse files Browse the repository at this point in the history
  • Loading branch information
trasher committed Jul 5, 2024
1 parent ebf789a commit 2aa81dc
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
5 changes: 2 additions & 3 deletions phpunit/functional/CommonDBTMTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public function testGetEmpty()
*
* @return array
*/
protected function getTableProvider()
public static function getTableProvider()
{
return [
[\DBConnection::class, ''], // "static protected $notable = true;" case
Expand Down Expand Up @@ -935,7 +935,6 @@ public function testUpdate()
$this->assertSame('renamed', $computer->fields['name']);
}


public function testTimezones()
{
global $DB;
Expand Down Expand Up @@ -1001,7 +1000,7 @@ public function testCircularRelation()
$this->assertFalse(\Project::checkCircularRelation($project_id_4, $project_id_3));
}

protected function relationConfigProvider()
public static function relationConfigProvider()
{
return [
[
Expand Down
2 changes: 1 addition & 1 deletion phpunit/functional/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ public function testPasswordExpirationDelayUpdate()
);
}

protected function logConfigChangeProvider()
public static function logConfigChangeProvider()
{
global $PLUGIN_HOOKS;

Expand Down
2 changes: 1 addition & 1 deletion phpunit/functional/HtmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ public function testGetScssFileHash()
}


protected function testGetGenericDateTimeSearchItemsProvider(): array
public static function testGetGenericDateTimeSearchItemsProvider(): array
{
return [
[
Expand Down
2 changes: 1 addition & 1 deletion phpunit/functional/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ public function testConvertFiltersValuesToSqlCriteria($filters_values, $expected
$this->assertSame($expected_result, \Log::convertFiltersValuesToSqlCriteria($filters_values));
}

protected function userNameFormattingProvider()
public static function userNameFormattingProvider()
{
return [
[TU_USER, TU_PASS, TU_USER],
Expand Down
18 changes: 9 additions & 9 deletions phpunit/functional/ToolboxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ public function testGetPictureUrl($path, $url)
/**
* Data provider for self::testConvertTagToImage().
*/
protected function convertTagToImageProvider()
public static function convertTagToImageProvider()
{
$data = [];

Expand Down Expand Up @@ -636,7 +636,7 @@ public function testConvertTagToImage($item, $expected_url)
/**
* Data provider for self::testBaseUrlInConvertTagToImage().
*/
protected function convertTagToImageBaseUrlProvider()
public static function convertTagToImageBaseUrlProvider()
{
$item = new \Ticket();
$item->fields['id'] = mt_rand(1, 50);
Expand Down Expand Up @@ -894,7 +894,7 @@ public function testConvertTagToImageWithDuplicatedInlinedImg()
);
}

protected function shortenNumbers()
public static function shortenNumbers()
{
return [
[
Expand Down Expand Up @@ -1141,7 +1141,7 @@ public function testFutureDeprecated()
}


public function hasTraitProvider()
public static function hasTraitProvider()
{
return [
[\Computer::class, Clonable::class, true],
Expand Down Expand Up @@ -1196,7 +1196,7 @@ public function testGetDocumentsFromTag()
$this->AssertCount(1, $output);
}

public function appendParametersProvider()
public static function appendParametersProvider()
{
return [
[
Expand Down Expand Up @@ -1258,7 +1258,7 @@ public function testAppendParameters(array $params, string $separator, string $e
*
* @return Generator
*/
protected function testIsFloatProvider(): Generator
public static function testIsFloatProvider(): Generator
{
yield [
'value' => null,
Expand Down Expand Up @@ -1347,7 +1347,7 @@ public function testIsFloat($value, bool $expected, ?string $warning = null): vo
*
* @return Generator
*/
protected function testgetDecimalNumbersProvider(): Generator
public static function testgetDecimalNumbersProvider(): Generator
{
yield [
'value' => "1",
Expand Down Expand Up @@ -1431,7 +1431,7 @@ public function testGetDecimalNumbers($value, int $decimals, ?string $warning =
*
* @return Generator
*/
protected function testGetMioSizeFromStringProvider(): Generator
public static function testGetMioSizeFromStringProvider(): Generator
{
yield [
'size' => "1024",
Expand Down Expand Up @@ -1505,7 +1505,7 @@ public function testGetMioSizeFromString(string $size, $expected): void
$this->assertEquals($expected, $result);
}

protected function safeUrlProvider(): iterable
public static function safeUrlProvider(): iterable
{
// Invalid URLs are refused
yield [
Expand Down

0 comments on commit 2aa81dc

Please sign in to comment.