Skip to content

Commit 497740d

Browse files
committed
fix phpunit deprecations & warnings
1 parent 6052973 commit 497740d

File tree

4 files changed

+25
-37
lines changed

4 files changed

+25
-37
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ composer.phar
33
composer.lock
44
.DS_Store
55
.idea/
6-
.phpunit.result.cache
6+
.phpunit.cache

phpunit.xml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3-
<coverage>
4-
<include>
5-
<directory suffix=".php">src/</directory>
6-
</include>
7-
</coverage>
8-
<testsuites>
9-
<testsuite name="Renoki Co Test Suite">
10-
<directory>tests</directory>
11-
</testsuite>
12-
</testsuites>
13-
<php>
14-
<server name="APP_ENV" value="testing"/>
15-
</php>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
cacheDirectory=".phpunit.cache"
6+
failOnRisky="true"
7+
failOnWarning="true">
8+
<testsuites>
9+
<testsuite name="Renoki Co Test Suite">
10+
<directory>tests</directory>
11+
</testsuite>
12+
</testsuites>
13+
14+
<php>
15+
<server name="APP_ENV" value="testing"/>
16+
</php>
17+
18+
<source restrictNotices="true" restrictWarnings="true">
19+
<include>
20+
<directory>src</directory>
21+
</include>
22+
</source>
1623
</phpunit>

psalm.xml

Lines changed: 0 additions & 18 deletions
This file was deleted.

tests/KubeConfigTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace RenokiCo\PhpK8s\Test;
44

5+
use PHPUnit\Framework\Attributes\DataProvider;
56
use RenokiCo\PhpK8s\Exceptions\KubeConfigBaseEncodedDataInvalid;
67
use RenokiCo\PhpK8s\Exceptions\KubeConfigClusterNotFound;
78
use RenokiCo\PhpK8s\Exceptions\KubeConfigContextNotFound;
@@ -208,10 +209,8 @@ public function test_in_cluster_config()
208209
K8sResource::setDefaultNamespace('default');
209210
}
210211

211-
/**
212-
* @dataProvider environmentVariableContextProvider
213-
*/
214-
public function test_from_environment_variable(string $context = null, string $expectedDomain)
212+
#[DataProvider('environmentVariableContextProvider')]
213+
public function test_from_environment_variable(?string $context, string $expectedDomain)
215214
{
216215
$_SERVER['KUBECONFIG'] = __DIR__.'/cluster/kubeconfig.yaml::'.__DIR__.'/cluster/kubeconfig-2.yaml';
217216

0 commit comments

Comments
 (0)