Skip to content

Commit 25c0418

Browse files
committed
Update PHPUnit
1 parent 713e646 commit 25c0418

File tree

4 files changed

+28
-62
lines changed

4 files changed

+28
-62
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"require-dev": {
2222
"orchestra/testbench": "^9.0",
2323
"laravel/pint": "^1.14",
24-
"phpunit/phpunit": "^9.6.17 || ^10.5.13"
24+
"phpunit/phpunit": "^11.4.3"
2525
},
2626
"autoload": {
2727
"psr-4": {

phpunit.xml.dist

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
5-
beStrictAboutOutputDuringTests="true"
6-
colors="true"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
5+
beStrictAboutOutputDuringTests="true"
6+
colors="true"
77
>
88
<testsuites>
99
<testsuite name="Test Suite">
1010
<directory>tests</directory>
1111
</testsuite>
1212
</testsuites>
1313

14-
<coverage ignoreDeprecatedCodeUnits="true" processUncoveredFiles="true">
14+
<source>
1515
<include>
16-
<directory suffix=".php">src</directory>
16+
<directory>src</directory>
1717
</include>
1818
<exclude>
1919
<directory>src/Facades</directory>
2020
</exclude>
21-
</coverage>
21+
</source>
2222

2323
<php>
2424
<ini name="date.timezone" value="UTC"/>

tests/FirebaseProjectManagerTest.php

Lines changed: 17 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Kreait\Firebase\Exception\InvalidArgumentException;
1010
use Kreait\Firebase\Factory;
1111
use Kreait\Laravel\Firebase\FirebaseProjectManager;
12+
use PHPUnit\Framework\Attributes\Test;
1213
use Psr\Cache\CacheItemPoolInterface;
1314
use ReflectionObject;
1415

@@ -22,9 +23,7 @@ protected function defineEnvironment($app): void
2223
$app['config']->set('firebase.projects.app.credentials', __DIR__.'/_fixtures/service_account.json');
2324
}
2425

25-
/**
26-
* @test
27-
*/
26+
#[Test]
2827
public function a_project_configuration_has_to_exist(): void
2928
{
3029
$manager = $this->app->make(FirebaseProjectManager::class);
@@ -36,9 +35,7 @@ public function a_project_configuration_has_to_exist(): void
3635
$this->getAccessibleMethod($manager, 'configuration')->invoke($manager, $projectName);
3736
}
3837

39-
/**
40-
* @test
41-
*/
38+
#[Test]
4239
public function a_default_project_can_be_set(): void
4340
{
4441
$manager = $this->app->make(FirebaseProjectManager::class);
@@ -51,9 +48,7 @@ public function a_default_project_can_be_set(): void
5148
$this->assertSame($projectName, $this->app->config->get('firebase.default'), 'default project should be set in config');
5249
}
5350

54-
/**
55-
* @test
56-
*/
51+
#[Test]
5752
public function calls_are_passed_to_default_project(): void
5853
{
5954
$manager = $this->app->make(FirebaseProjectManager::class);
@@ -63,9 +58,7 @@ public function calls_are_passed_to_default_project(): void
6358
$this->assertSame($manager->project($projectName)->auth(), $manager->auth());
6459
}
6560

66-
/**
67-
* @test
68-
*/
61+
#[Test]
6962
public function credentials_can_be_configured_using_a_json_file(): void
7063
{
7164
// Reference credentials
@@ -84,9 +77,7 @@ public function credentials_can_be_configured_using_a_json_file(): void
8477
$this->assertSame($credentials, $serviceAccount);
8578
}
8679

87-
/**
88-
* @test
89-
*/
80+
#[Test]
9081
public function json_file_credentials_can_be_used_using_the_deprecated_configuration_entry(): void
9182
{
9283
// Reference credentials
@@ -105,9 +96,7 @@ public function json_file_credentials_can_be_used_using_the_deprecated_configura
10596
$this->assertSame($credentials, $serviceAccount);
10697
}
10798

108-
/**
109-
* @test
110-
*/
99+
#[Test]
111100
public function credentials_can_be_configured_using_an_array(): void
112101
{
113102
// Set configuration and retrieve project
@@ -133,9 +122,7 @@ public function credentials_can_be_configured_using_an_array(): void
133122
$this->assertSame($credentials, $serviceAccount);
134123
}
135124

136-
/**
137-
* @test
138-
*/
125+
#[Test]
139126
public function projects_can_have_different_credentials(): void
140127
{
141128
// Reference credentials
@@ -165,9 +152,7 @@ public function projects_can_have_different_credentials(): void
165152
$this->assertSame($secondCredentials, $secondServiceAccount);
166153
}
167154

168-
/**
169-
* @test
170-
*/
155+
#[Test]
171156
public function the_realtime_database_url_can_be_configured(): void
172157
{
173158
$projectName = $this->app->config->get('firebase.default');
@@ -181,9 +166,7 @@ public function the_realtime_database_url_can_be_configured(): void
181166
$this->assertSame($url, (string) $property->getValue($database));
182167
}
183168

184-
/**
185-
* @test
186-
*/
169+
#[Test]
187170
public function the_dynamic_links_default_domain_can_be_configured(): void
188171
{
189172
$projectName = $this->app->config->get('firebase.default');
@@ -198,9 +181,7 @@ public function the_dynamic_links_default_domain_can_be_configured(): void
198181
$this->assertSame($domain, $configuredDomain);
199182
}
200183

201-
/**
202-
* @test
203-
*/
184+
#[Test]
204185
public function the_storage_default_bucket_can_be_configured(): void
205186
{
206187
$projectName = $this->app->config->get('firebase.default');
@@ -213,9 +194,7 @@ public function the_storage_default_bucket_can_be_configured(): void
213194
$this->assertSame($name, $property->getValue($storage));
214195
}
215196

216-
/**
217-
* @test
218-
*/
197+
#[Test]
219198
public function logging_can_be_configured(): void
220199
{
221200
$projectName = $this->app->config->get('firebase.default');
@@ -228,9 +207,7 @@ public function logging_can_be_configured(): void
228207
$this->assertNotNull($property->getValue($factory));
229208
}
230209

231-
/**
232-
* @test
233-
*/
210+
#[Test]
234211
public function debug_logging_can_be_configured(): void
235212
{
236213
$projectName = $this->app->config->get('firebase.default');
@@ -243,9 +220,7 @@ public function debug_logging_can_be_configured(): void
243220
$this->assertNotNull($property->getValue($factory));
244221
}
245222

246-
/**
247-
* @test
248-
*/
223+
#[Test]
249224
public function http_client_options_can_be_configured(): void
250225
{
251226
$projectName = $this->app->config->get('firebase.default');
@@ -263,9 +238,7 @@ public function http_client_options_can_be_configured(): void
263238
$this->assertSame([RetryMiddleware::class], $httpClientOptions->guzzleMiddlewares());
264239
}
265240

266-
/**
267-
* @test
268-
*/
241+
#[Test]
269242
public function it_uses_the_laravel_cache_as_verifier_cache(): void
270243
{
271244
$projectName = $this->app->config->get('firebase.default');
@@ -276,9 +249,7 @@ public function it_uses_the_laravel_cache_as_verifier_cache(): void
276249
$this->assertInstanceOf(CacheItemPoolInterface::class, $property->getValue($factory));
277250
}
278251

279-
/**
280-
* @test
281-
*/
252+
#[Test]
282253
public function it_overrides_the_default_firestore_database(): void
283254
{
284255
config(['firebase.projects.app.firestore.database' => 'override-database']);
@@ -290,9 +261,7 @@ public function it_overrides_the_default_firestore_database(): void
290261
$this->assertEquals('override-database', $property->getValue($factory)['database']);
291262
}
292263

293-
/**
294-
* @test
295-
*/
264+
#[Test]
296265
public function it_uses_the_laravel_cache_as_auth_token_cache(): void
297266
{
298267
$projectName = $this->app->config->get('firebase.default');

tests/ServiceProviderTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
namespace Kreait\Laravel\Firebase\Tests;
66

77
use Kreait\Firebase;
8+
use PHPUnit\Framework\Attributes\Test;
89

910
/**
1011
* @internal
1112
*/
1213
final class ServiceProviderTest extends TestCase
1314
{
14-
/**
15-
* @test
16-
*/
15+
#[Test]
1716
public function it_provides_components(): void
1817
{
1918
$this->app->config->set('firebase.projects.app.credentials', \realpath(__DIR__.'/_fixtures/service_account.json'));
@@ -27,9 +26,7 @@ public function it_provides_components(): void
2726
$this->assertInstanceOf(Firebase\Contract\Storage::class, $this->app->make(Firebase\Contract\Storage::class));
2827
}
2928

30-
/**
31-
* @test
32-
*/
29+
#[Test]
3330
public function it_does_not_provide_optional_components(): void
3431
{
3532
$this->expectException(\Throwable::class);

0 commit comments

Comments
 (0)