Skip to content

Commit

Permalink
Refactor the tests for newer Phpunit version
Browse files Browse the repository at this point in the history
  • Loading branch information
Zvax committed Nov 26, 2024
1 parent 9b07c50 commit d6c1584
Show file tree
Hide file tree
Showing 7 changed files with 471 additions and 480 deletions.
8 changes: 8 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

return (new \PhpCsFixer\Config())
->setFinder(
(new \PhpCsFixer\Finder())
->in(__DIR__ . "/lib")
->in(__DIR__ . "/test")
);
15 changes: 0 additions & 15 deletions .php_cs

This file was deleted.

6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
"php": ">=7.1"
},
"require-dev": {
"phpunit/phpunit": "^4.8",
"fabpot/php-cs-fixer": "~1.9",
"athletic/athletic": "~0.1"
"phpunit/phpunit": ">=7",
"friendsofphp/php-cs-fixer": "^3",
"athletic/athletic": "^0.1"
},
"autoload": {
"psr-4": {
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="vendor/autoload.php"
>
<testsuites>
Expand Down
910 changes: 452 additions & 458 deletions test/InjectorTest.php

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion test/fixtures.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Auryn\Test;
namespace Auryn;

class InaccessibleExecutableClassMethod
{
Expand Down Expand Up @@ -158,6 +158,7 @@ class SpecdTestDependency extends TestDependency

class TestNeedsDep
{
public $testDep;
public function __construct(TestDependency $testDep)
{
$this->testDep = $testDep;
Expand All @@ -174,6 +175,8 @@ public function __construct($val = 42)

class TestMultiDepsNeeded
{
public $testDep;

public function __construct(TestDependency $val1, TestDependency2 $val2)
{
$this->testDep = $val1;
Expand All @@ -184,6 +187,8 @@ public function __construct(TestDependency $val1, TestDependency2 $val2)

class TestMultiDepsWithCtor
{
public $testDep;

public function __construct(TestDependency $val1, TestNeedsDep $val2)
{
$this->testDep = $val1;
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures_5_6.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Auryn\Test;
namespace Auryn;

class NoTypehintNoDefaultConstructorVariadicClass
{
Expand All @@ -18,4 +18,4 @@ public function __construct(TestDependency ...$arg)
{
$this->testParam = $arg;
}
}
}

0 comments on commit d6c1584

Please sign in to comment.