Skip to content

Commit

Permalink
build: upgrade PHPUnit
Browse files Browse the repository at this point in the history
  • Loading branch information
phanan authored and lstrojny committed Mar 6, 2021
1 parent aba599e commit 7ca083c
Show file tree
Hide file tree
Showing 56 changed files with 208 additions and 161 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
php-versions: ['7.3', '7.4', '8.0', '8.1']
fail-fast: false
steps:
- uses: actions/checkout@v1
Expand Down
8 changes: 7 additions & 1 deletion .idea/functional-php.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 78 additions & 5 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .phpunit.result.cache

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -18,9 +18,9 @@
"php": "~7|~8"
},
"require-dev": {
"phpunit/phpunit": "~7",
"squizlabs/php_codesniffer": "~3.0",
"friendsofphp/php-cs-fixer": "^2.14"
"friendsofphp/php-cs-fixer": "^2.14",
"phpunit/phpunit": "^9.5"
},
"autoload": {
"psr-4": {"Functional\\": "src/Functional"},
Expand Down
11 changes: 5 additions & 6 deletions tests/Functional/AbstractTestCase.php
Expand Up @@ -32,17 +32,16 @@ class AbstractTestCase extends TestCase

private $functions = [];

public function setUp()
public function setUp(): void
{
$this->functions = F\flatten(
(array) (
func_num_args() > 0
? func_get_arg(0)
: $this->getFunctionName()
func_num_args() > 0
? func_get_arg(0)
: $this->getFunctionName()
)
);


foreach ($this->functions as $function) {
if (!function_exists($function)) {
$this->markTestSkipped(
Expand Down Expand Up @@ -111,6 +110,6 @@ private function getFunctionName()
)
);

return 'Functional\\' . $function;
return 'Functional\\'.$function;
}
}
8 changes: 4 additions & 4 deletions tests/Functional/AverageTest.php
Expand Up @@ -68,10 +68,10 @@ public function test()
$this->assertSame(5, average($this->list));
$this->assertSame(5, average($this->listIterator));

$this->assertEquals(0.833333333, average($this->hash2), '', 0.001);
$this->assertEquals(0.833333333, average($this->hashIterator2), '', 0.001);
$this->assertEquals(0.833333333, average($this->list2), '', 0.001);
$this->assertEquals(0.833333333, average($this->listIterator2), '', 0.001);
$this->assertEqualsWithDelta(0.833333333, average($this->hash2), 0.001);
$this->assertEqualsWithDelta(0.833333333, average($this->hashIterator2), 0.001);
$this->assertEqualsWithDelta(0.833333333, average($this->list2), 0.001);
$this->assertEqualsWithDelta(0.833333333, average($this->listIterator2), 0.001);

$this->assertNull(average($this->hash3));
$this->assertNull(average($this->hashIterator3));
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/ButLastTest.php
Expand Up @@ -17,7 +17,7 @@

class ButLastTest extends AbstractTestCase
{
public function setUp()
public function setUp(): void
{
parent::setUp();
$this->list = [1, 2, 3, 4];
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/ComposeTest.php
Expand Up @@ -14,7 +14,7 @@

class ComposeTest extends AbstractTestCase
{
public function setUp()
public function setUp(): void
{
parent::setUp();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/ConcatTest.php
Expand Up @@ -14,7 +14,7 @@

class ConcatTest extends AbstractTestCase
{
public function setUp()
public function setUp(): void
{
parent::setUp();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/DifferenceTest.php
Expand Up @@ -16,7 +16,7 @@

class DifferenceTest extends AbstractTestCase
{
public function setUp()
public function setUp(): void
{
parent::setUp();
$this->intArray = [1 => 1, 2, "foo" => 3, 4];
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/DropTest.php
Expand Up @@ -18,7 +18,7 @@

class DropTest extends AbstractTestCase
{
public function setUp()
public function setUp(): void
{
parent::setUp('Functional\drop_first', 'Functional\drop_last');
$this->list = ['value1', 'value2', 'value3', 'value4'];
Expand Down

0 comments on commit 7ca083c

Please sign in to comment.