Skip to content

Commit dcbfda0

Browse files
committed
Add return types to test methods
1 parent 1a6c520 commit dcbfda0

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

tests/Feature/SetLocaleTest.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected function setUp(): void
3535
}
3636

3737
#[Test]
38-
public function it_looks_for_a_locale_in_a_custom_route_action()
38+
public function it_looks_for_a_locale_in_a_custom_route_action(): void
3939
{
4040
$this->setSupportedLocales(['en', 'nl']);
4141
$this->setAppLocale('en');
@@ -56,7 +56,7 @@ public function it_looks_for_a_locale_in_a_custom_route_action()
5656
}
5757

5858
#[Test]
59-
public function it_looks_for_a_locale_in_the_url()
59+
public function it_looks_for_a_locale_in_the_url(): void
6060
{
6161
$this->setSupportedLocales(['en', 'nl']);
6262
$this->setAppLocale('en');
@@ -73,7 +73,7 @@ public function it_looks_for_a_locale_in_the_url()
7373
}
7474

7575
#[Test]
76-
public function you_can_configure_which_segment_to_use_as_locale()
76+
public function you_can_configure_which_segment_to_use_as_locale(): void
7777
{
7878
$this->setSupportedLocales(['en', 'nl']);
7979
$this->setAppLocale('en');
@@ -92,7 +92,7 @@ public function you_can_configure_which_segment_to_use_as_locale()
9292
}
9393

9494
#[Test]
95-
public function it_looks_for_custom_slugs()
95+
public function it_looks_for_custom_slugs(): void
9696
{
9797
$this->setSupportedLocales([
9898
'en' => 'english',
@@ -112,7 +112,7 @@ public function it_looks_for_custom_slugs()
112112
}
113113

114114
#[Test]
115-
public function you_can_use_multiple_slugs_for_a_locale()
115+
public function you_can_use_multiple_slugs_for_a_locale(): void
116116
{
117117
$this->setSupportedLocales([
118118
'en' => 'english',
@@ -142,7 +142,7 @@ public function you_can_use_multiple_slugs_for_a_locale()
142142
}
143143

144144
#[Test]
145-
public function it_looks_for_custom_domains()
145+
public function it_looks_for_custom_domains(): void
146146
{
147147
$this->setSupportedLocales([
148148
'en' => 'english.test',
@@ -164,7 +164,7 @@ public function it_looks_for_custom_domains()
164164
}
165165

166166
#[Test]
167-
public function you_can_use_multiple_domains_for_a_locale()
167+
public function you_can_use_multiple_domains_for_a_locale(): void
168168
{
169169
$this->setSupportedLocales([
170170
'en' => 'english.test',
@@ -198,7 +198,7 @@ public function you_can_use_multiple_domains_for_a_locale()
198198
}
199199

200200
#[Test]
201-
public function it_checks_for_a_configured_omitted_locale()
201+
public function it_checks_for_a_configured_omitted_locale(): void
202202
{
203203
$this->setSupportedLocales(['en', 'nl']);
204204
$this->setAppLocale('en');
@@ -217,7 +217,7 @@ public function it_checks_for_a_configured_omitted_locale()
217217
}
218218

219219
#[Test]
220-
public function it_looks_for_a_locale_on_the_authenticated_user()
220+
public function it_looks_for_a_locale_on_the_authenticated_user(): void
221221
{
222222
$this->setSupportedLocales(['en', 'nl']);
223223
$this->setAppLocale('en');
@@ -238,7 +238,7 @@ public function it_looks_for_a_locale_on_the_authenticated_user()
238238
}
239239

240240
#[Test]
241-
public function it_will_bypass_missing_attribute_exception_if_the_locale_attribute_is_missing_on_the_user_model()
241+
public function it_will_bypass_missing_attribute_exception_if_the_locale_attribute_is_missing_on_the_user_model(): void
242242
{
243243
if (version_compare(App::version(), '9.35.0') === -1) {
244244
$this->markTestSkipped('This test only applies to Laravel 9.35.0 and higher.');
@@ -263,7 +263,7 @@ public function it_will_bypass_missing_attribute_exception_if_the_locale_attribu
263263
}
264264

265265
#[Test]
266-
public function it_looks_for_a_locale_in_the_session()
266+
public function it_looks_for_a_locale_in_the_session(): void
267267
{
268268
$this->setSupportedLocales(['en', 'nl']);
269269
$this->setAppLocale('en');
@@ -282,7 +282,7 @@ public function it_looks_for_a_locale_in_the_session()
282282
}
283283

284284
#[Test]
285-
public function it_looks_for_a_locale_in_a_cookie()
285+
public function it_looks_for_a_locale_in_a_cookie(): void
286286
{
287287
$this->setSupportedLocales(['en', 'nl']);
288288
$this->setAppLocale('en');
@@ -302,7 +302,7 @@ public function it_looks_for_a_locale_in_a_cookie()
302302
}
303303

304304
#[Test]
305-
public function it_looks_for_a_locale_in_the_browser()
305+
public function it_looks_for_a_locale_in_the_browser(): void
306306
{
307307
$this->setSupportedLocales(['en', 'nl']);
308308
$this->setAppLocale('en');
@@ -321,7 +321,7 @@ public function it_looks_for_a_locale_in_the_browser()
321321
}
322322

323323
#[Test]
324-
public function it_returns_the_best_match_when_a_browser_locale_is_used()
324+
public function it_returns_the_best_match_when_a_browser_locale_is_used(): void
325325
{
326326
$this->setSupportedLocales(['en', 'nl', 'fr']);
327327
$this->setAppLocale('en');
@@ -340,7 +340,7 @@ public function it_returns_the_best_match_when_a_browser_locale_is_used()
340340
}
341341

342342
#[Test]
343-
public function it_looks_for_the_current_app_locale()
343+
public function it_looks_for_the_current_app_locale(): void
344344
{
345345
$this->setSupportedLocales(['en', 'nl']);
346346
$this->setAppLocale('nl');
@@ -357,7 +357,7 @@ public function it_looks_for_the_current_app_locale()
357357
}
358358

359359
#[Test]
360-
public function trusted_detectors_ignore_supported_locales_and_may_set_any_locale()
360+
public function trusted_detectors_ignore_supported_locales_and_may_set_any_locale(): void
361361
{
362362
$this->setSupportedLocales(['en']);
363363
$this->setAppLocale('en');

tests/Unit/LocalizerTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
class LocalizerTest extends TestCase
1414
{
1515
#[Test]
16-
public function it_loops_through_the_detectors_and_returns_the_first_supported_locale()
16+
public function it_loops_through_the_detectors_and_returns_the_first_supported_locale(): void
1717
{
1818
$supportedLocales = ['en', 'nl'];
1919
$detectors = [
@@ -28,7 +28,7 @@ public function it_loops_through_the_detectors_and_returns_the_first_supported_l
2828
}
2929

3030
#[Test]
31-
public function it_returns_the_first_match_if_an_array_of_locales_is_detected()
31+
public function it_returns_the_first_match_if_an_array_of_locales_is_detected(): void
3232
{
3333
$supportedLocales = ['en', 'nl'];
3434
$detectors = [
@@ -41,7 +41,7 @@ public function it_returns_the_first_match_if_an_array_of_locales_is_detected()
4141
}
4242

4343
#[Test]
44-
public function trusted_detectors_ignore_supported_locales_and_may_set_any_locale()
44+
public function trusted_detectors_ignore_supported_locales_and_may_set_any_locale(): void
4545
{
4646
$supportedLocales = ['en'];
4747
$detectors = [
@@ -57,7 +57,7 @@ public function trusted_detectors_ignore_supported_locales_and_may_set_any_local
5757
}
5858

5959
#[Test]
60-
public function it_skips_null_and_false_and_empty_values()
60+
public function it_skips_null_and_false_and_empty_values(): void
6161
{
6262
App::instance(Detector::class, Mockery::mock(Detector::class)->allows()->detect()->andReturns('')->getMock());
6363

@@ -77,7 +77,7 @@ public function it_skips_null_and_false_and_empty_values()
7777
}
7878

7979
#[Test]
80-
public function it_skips_null_and_false_and_empty_values_from_trusted_detectors()
80+
public function it_skips_null_and_false_and_empty_values_from_trusted_detectors(): void
8181
{
8282
App::instance(Detector::class, Mockery::mock(Detector::class)->allows()->detect()->andReturns('')->getMock());
8383

@@ -100,7 +100,7 @@ public function it_skips_null_and_false_and_empty_values_from_trusted_detectors(
100100
}
101101

102102
#[Test]
103-
public function it_returns_false_if_no_supported_locale_could_be_detected()
103+
public function it_returns_false_if_no_supported_locale_could_be_detected(): void
104104
{
105105
$supportedLocales = ['en'];
106106
$detectors = [
@@ -115,7 +115,7 @@ public function it_returns_false_if_no_supported_locale_could_be_detected()
115115
}
116116

117117
#[Test]
118-
public function it_loops_through_the_stores_and_calls_the_store_method_with_the_given_locale()
118+
public function it_loops_through_the_stores_and_calls_the_store_method_with_the_given_locale(): void
119119
{
120120
$stores = [
121121
Mockery::mock(Store::class)->expects()->store('nl')->once()->getMock(),
@@ -129,7 +129,7 @@ public function it_loops_through_the_stores_and_calls_the_store_method_with_the_
129129
}
130130

131131
#[Test]
132-
public function it_accepts_class_names_instead_of_instances_in_the_constructor()
132+
public function it_accepts_class_names_instead_of_instances_in_the_constructor(): void
133133
{
134134
App::instance(Store::class, Mockery::mock(Store::class)->expects()->store('nl')->once()->getMock());
135135
App::instance(Detector::class, Mockery::mock(Detector::class)->expects()->detect()->once()->getMock());
@@ -144,7 +144,7 @@ public function it_accepts_class_names_instead_of_instances_in_the_constructor()
144144
}
145145

146146
#[Test]
147-
public function you_can_set_the_supported_locales_at_runtime()
147+
public function you_can_set_the_supported_locales_at_runtime(): void
148148
{
149149
$supportedLocales = ['en'];
150150
$detectors = [

0 commit comments

Comments
 (0)