mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-03 01:34:34 +02:00
Applied rectors phpunit 9 migrations to tests
This commit is contained in:
parent
684334ba22
commit
fcbb1849ec
22 changed files with 162 additions and 187 deletions
|
@ -63,11 +63,9 @@ class AbstractElementProviderTest extends WebTestCase
|
|||
};
|
||||
}
|
||||
|
||||
public function dataProvider(): array
|
||||
public function dataProvider(): \Iterator
|
||||
{
|
||||
return [
|
||||
['123', '[[ID]]'],
|
||||
];
|
||||
yield ['123', '[[ID]]'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -61,12 +61,10 @@ class GlobalProvidersTest extends WebTestCase
|
|||
$this->target = new Part();
|
||||
}
|
||||
|
||||
public function dataProvider(): array
|
||||
public function dataProvider(): \Iterator
|
||||
{
|
||||
return [
|
||||
['Part-DB', '[[INSTALL_NAME]]'],
|
||||
['anonymous', '[[USERNAME]]'],
|
||||
];
|
||||
yield ['Part-DB', '[[INSTALL_NAME]]'];
|
||||
yield ['anonymous', '[[USERNAME]]'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -66,11 +66,9 @@ class NamedElementProviderTest extends WebTestCase
|
|||
};
|
||||
}
|
||||
|
||||
public function dataProvider(): array
|
||||
public function dataProvider(): \Iterator
|
||||
{
|
||||
return [
|
||||
['This is my Name', '[[NAME]]'],
|
||||
];
|
||||
yield ['This is my Name', '[[NAME]]'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -85,22 +85,20 @@ class PartLotProviderTest extends WebTestCase
|
|||
$this->target->setOwner($user);
|
||||
}
|
||||
|
||||
public function dataProvider(): array
|
||||
public function dataProvider(): \Iterator
|
||||
{
|
||||
return [
|
||||
['unknown', '[[LOT_ID]]'],
|
||||
['Lot description', '[[LOT_NAME]]'],
|
||||
['Lot comment', '[[LOT_COMMENT]]'],
|
||||
['4/13/99', '[[EXPIRATION_DATE]]'],
|
||||
['?', '[[AMOUNT]]'],
|
||||
['Location', '[[LOCATION]]'],
|
||||
['Parent → Location', '[[LOCATION_FULL]]'],
|
||||
//Test part inheritance
|
||||
['Part', '[[NAME]]'],
|
||||
['Part description', '[[DESCRIPTION]]'],
|
||||
['John Doe', '[[OWNER]]'],
|
||||
['user', '[[OWNER_USERNAME]]'],
|
||||
];
|
||||
yield ['unknown', '[[LOT_ID]]'];
|
||||
yield ['Lot description', '[[LOT_NAME]]'];
|
||||
yield ['Lot comment', '[[LOT_COMMENT]]'];
|
||||
yield ['4/13/99', '[[EXPIRATION_DATE]]'];
|
||||
yield ['?', '[[AMOUNT]]'];
|
||||
yield ['Location', '[[LOCATION]]'];
|
||||
yield ['Parent → Location', '[[LOCATION_FULL]]'];
|
||||
//Test part inheritance
|
||||
yield ['Part', '[[NAME]]'];
|
||||
yield ['Part description', '[[DESCRIPTION]]'];
|
||||
yield ['John Doe', '[[OWNER]]'];
|
||||
yield ['user', '[[OWNER_USERNAME]]'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -86,25 +86,22 @@ class PartProviderTest extends WebTestCase
|
|||
$this->target->setComment('<b>Bold</b> *Italic*');
|
||||
}
|
||||
|
||||
public function dataProvider(): array
|
||||
public function dataProvider(): \Iterator
|
||||
{
|
||||
return [
|
||||
['Node 2.1', '[[CATEGORY]]'],
|
||||
['Node 2 → Node 2.1', '[[CATEGORY_FULL]]'],
|
||||
['Node 2.1', '[[FOOTPRINT]]'],
|
||||
['Node 2 → Node 2.1', '[[FOOTPRINT_FULL]]'],
|
||||
['', '[[MANUFACTURER]]'],
|
||||
['', '[[MANUFACTURER_FULL]]'],
|
||||
|
||||
['1.2 kg', '[[MASS]]'],
|
||||
['MPN123', '[[MPN]]'],
|
||||
['SMD, Tag1, Tag2', '[[TAGS]]'],
|
||||
['Active', '[[M_STATUS]]'],
|
||||
['<b>Bold</b> <em>Italic</em>', '[[DESCRIPTION]]'],
|
||||
['Bold Italic', '[[DESCRIPTION_T]]'],
|
||||
['<b>Bold</b> <em>Italic</em>', '[[COMMENT]]'],
|
||||
['Bold Italic', '[[COMMENT_T]]'],
|
||||
];
|
||||
yield ['Node 2.1', '[[CATEGORY]]'];
|
||||
yield ['Node 2 → Node 2.1', '[[CATEGORY_FULL]]'];
|
||||
yield ['Node 2.1', '[[FOOTPRINT]]'];
|
||||
yield ['Node 2 → Node 2.1', '[[FOOTPRINT_FULL]]'];
|
||||
yield ['', '[[MANUFACTURER]]'];
|
||||
yield ['', '[[MANUFACTURER_FULL]]'];
|
||||
yield ['1.2 kg', '[[MASS]]'];
|
||||
yield ['MPN123', '[[MPN]]'];
|
||||
yield ['SMD, Tag1, Tag2', '[[TAGS]]'];
|
||||
yield ['Active', '[[M_STATUS]]'];
|
||||
yield ['<b>Bold</b> <em>Italic</em>', '[[DESCRIPTION]]'];
|
||||
yield ['Bold Italic', '[[DESCRIPTION_T]]'];
|
||||
yield ['<b>Bold</b> <em>Italic</em>', '[[COMMENT]]'];
|
||||
yield ['Bold Italic', '[[COMMENT_T]]'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -74,14 +74,11 @@ class TimestampableElementProviderTest extends WebTestCase
|
|||
};
|
||||
}
|
||||
|
||||
public function dataProvider(): array
|
||||
public function dataProvider(): \Iterator
|
||||
{
|
||||
\Locale::setDefault('en');
|
||||
|
||||
return [
|
||||
['1/1/00, 12:00 AM', '[[LAST_MODIFIED]]'],
|
||||
['1/1/00, 12:00 AM', '[[CREATION_DATE]]'],
|
||||
];
|
||||
yield ['1/1/00, 12:00 AM', '[[LAST_MODIFIED]]'];
|
||||
yield ['1/1/00, 12:00 AM', '[[CREATION_DATE]]'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue