mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 01:31:45 +01:00
Reformat code
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
namespace Meritoo\Test\Common\Collection;
|
namespace Meritoo\Test\Common\Collection;
|
||||||
|
|
||||||
use ArrayIterator;
|
use ArrayIterator;
|
||||||
|
use DateTime;
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Collection\BaseCollection;
|
use Meritoo\Common\Collection\BaseCollection;
|
||||||
use Meritoo\Common\Collection\DateTimeCollection;
|
use Meritoo\Common\Collection\DateTimeCollection;
|
||||||
@@ -377,14 +378,14 @@ class BaseCollectionTest extends BaseTestCase
|
|||||||
*/
|
*/
|
||||||
public function provideElementToAdd()
|
public function provideElementToAdd()
|
||||||
{
|
{
|
||||||
yield[
|
yield [
|
||||||
'This is test 1',
|
'This is test 1',
|
||||||
1,
|
1,
|
||||||
0,
|
0,
|
||||||
new StringCollection(),
|
new StringCollection(),
|
||||||
];
|
];
|
||||||
|
|
||||||
yield[
|
yield [
|
||||||
'This is test 2',
|
'This is test 2',
|
||||||
2,
|
2,
|
||||||
1,
|
1,
|
||||||
@@ -393,7 +394,7 @@ class BaseCollectionTest extends BaseTestCase
|
|||||||
]),
|
]),
|
||||||
];
|
];
|
||||||
|
|
||||||
yield[
|
yield [
|
||||||
'This is test 3',
|
'This is test 3',
|
||||||
3,
|
3,
|
||||||
2,
|
2,
|
||||||
@@ -411,7 +412,7 @@ class BaseCollectionTest extends BaseTestCase
|
|||||||
*/
|
*/
|
||||||
public function provideElementToAddWithIndex()
|
public function provideElementToAddWithIndex()
|
||||||
{
|
{
|
||||||
yield[
|
yield [
|
||||||
'This is test 1',
|
'This is test 1',
|
||||||
'test1',
|
'test1',
|
||||||
1,
|
1,
|
||||||
@@ -419,7 +420,7 @@ class BaseCollectionTest extends BaseTestCase
|
|||||||
new StringCollection(),
|
new StringCollection(),
|
||||||
];
|
];
|
||||||
|
|
||||||
yield[
|
yield [
|
||||||
'This is test 2',
|
'This is test 2',
|
||||||
'test2',
|
'test2',
|
||||||
2,
|
2,
|
||||||
@@ -429,7 +430,7 @@ class BaseCollectionTest extends BaseTestCase
|
|||||||
]),
|
]),
|
||||||
];
|
];
|
||||||
|
|
||||||
yield[
|
yield [
|
||||||
'This is test 3',
|
'This is test 3',
|
||||||
null,
|
null,
|
||||||
3,
|
3,
|
||||||
@@ -440,7 +441,7 @@ class BaseCollectionTest extends BaseTestCase
|
|||||||
]),
|
]),
|
||||||
];
|
];
|
||||||
|
|
||||||
yield[
|
yield [
|
||||||
'This is test 4',
|
'This is test 4',
|
||||||
'',
|
'',
|
||||||
4,
|
4,
|
||||||
@@ -452,7 +453,7 @@ class BaseCollectionTest extends BaseTestCase
|
|||||||
]),
|
]),
|
||||||
];
|
];
|
||||||
|
|
||||||
yield[
|
yield [
|
||||||
'This is test 5',
|
'This is test 5',
|
||||||
'test5',
|
'test5',
|
||||||
5,
|
5,
|
||||||
@@ -465,7 +466,7 @@ class BaseCollectionTest extends BaseTestCase
|
|||||||
]),
|
]),
|
||||||
];
|
];
|
||||||
|
|
||||||
yield[
|
yield [
|
||||||
'This is test 6',
|
'This is test 6',
|
||||||
'test2',
|
'test2',
|
||||||
4,
|
4,
|
||||||
@@ -481,21 +482,21 @@ class BaseCollectionTest extends BaseTestCase
|
|||||||
|
|
||||||
public function provideElementGetByIndex()
|
public function provideElementGetByIndex()
|
||||||
{
|
{
|
||||||
yield[
|
yield [
|
||||||
'An empty collection and empty index',
|
'An empty collection and empty index',
|
||||||
new StringCollection(),
|
new StringCollection(),
|
||||||
'',
|
'',
|
||||||
null,
|
null,
|
||||||
];
|
];
|
||||||
|
|
||||||
yield[
|
yield [
|
||||||
'An empty collection and non-empty index',
|
'An empty collection and non-empty index',
|
||||||
new StringCollection(),
|
new StringCollection(),
|
||||||
'test',
|
'test',
|
||||||
null,
|
null,
|
||||||
];
|
];
|
||||||
|
|
||||||
yield[
|
yield [
|
||||||
'Non-empty collection and not existing index',
|
'Non-empty collection and not existing index',
|
||||||
new StringCollection([
|
new StringCollection([
|
||||||
'lorem' => 'ipsum',
|
'lorem' => 'ipsum',
|
||||||
@@ -505,7 +506,7 @@ class BaseCollectionTest extends BaseTestCase
|
|||||||
null,
|
null,
|
||||||
];
|
];
|
||||||
|
|
||||||
yield[
|
yield [
|
||||||
'Collection with existing index',
|
'Collection with existing index',
|
||||||
new StringCollection([
|
new StringCollection([
|
||||||
'lorem' => 'ipsum',
|
'lorem' => 'ipsum',
|
||||||
@@ -515,7 +516,7 @@ class BaseCollectionTest extends BaseTestCase
|
|||||||
'ipsum',
|
'ipsum',
|
||||||
];
|
];
|
||||||
|
|
||||||
yield[
|
yield [
|
||||||
'Collection with existing index (collection of arrays)',
|
'Collection with existing index (collection of arrays)',
|
||||||
new FirstNamesCollection([
|
new FirstNamesCollection([
|
||||||
new User('John', 'Scott'),
|
new User('John', 'Scott'),
|
||||||
@@ -525,18 +526,18 @@ class BaseCollectionTest extends BaseTestCase
|
|||||||
'John',
|
'John',
|
||||||
];
|
];
|
||||||
|
|
||||||
yield[
|
yield [
|
||||||
'Collection with existing index (collection of objects)',
|
'Collection with existing index (collection of objects)',
|
||||||
new DateTimeCollection([
|
new DateTimeCollection([
|
||||||
'x' => new \DateTime(),
|
'x' => new DateTime(),
|
||||||
'y' => new \DateTime('2001-01-01'),
|
'y' => new DateTime('2001-01-01'),
|
||||||
'z' => new \DateTime('yesterday'),
|
'z' => new DateTime('yesterday'),
|
||||||
]),
|
]),
|
||||||
'y',
|
'y',
|
||||||
new \DateTime('2001-01-01'),
|
new DateTime('2001-01-01'),
|
||||||
];
|
];
|
||||||
|
|
||||||
yield[
|
yield [
|
||||||
'Collection with first names',
|
'Collection with first names',
|
||||||
new FirstNamesCollection([
|
new FirstNamesCollection([
|
||||||
new User('John', 'Scott'),
|
new User('John', 'Scott'),
|
||||||
@@ -549,13 +550,13 @@ class BaseCollectionTest extends BaseTestCase
|
|||||||
|
|
||||||
public function provideElementsToValidateType(): ?Generator
|
public function provideElementsToValidateType(): ?Generator
|
||||||
{
|
{
|
||||||
yield[
|
yield [
|
||||||
'An empty array',
|
'An empty array',
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
];
|
];
|
||||||
|
|
||||||
yield[
|
yield [
|
||||||
'Valid elements only',
|
'Valid elements only',
|
||||||
[
|
[
|
||||||
new User('John', 'Scott'),
|
new User('John', 'Scott'),
|
||||||
@@ -567,7 +568,7 @@ class BaseCollectionTest extends BaseTestCase
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
yield[
|
yield [
|
||||||
'Mixed elements',
|
'Mixed elements',
|
||||||
[
|
[
|
||||||
1,
|
1,
|
||||||
|
|||||||
Reference in New Issue
Block a user