|
60 | 60 | test('it can get available locales from array config', function () { |
61 | 61 | Config::set('eclipse-common.available_locales', ['en', 'sl']); |
62 | 62 |
|
63 | | - $locales = Helper::getAvailable(); |
| 63 | + $locales = Helper::getAvailableLocales(); |
64 | 64 |
|
65 | 65 | expect($locales)->toBeArray() |
66 | 66 | ->and($locales)->toHaveCount(2) |
|
70 | 70 | test('it can get available locales from callable config', function () { |
71 | 71 | Config::set('eclipse-common.available_locales', fn () => ['en', 'de']); |
72 | 72 |
|
73 | | - $locales = Helper::getAvailable(); |
| 73 | + $locales = Helper::getAvailableLocales(); |
74 | 74 |
|
75 | 75 | expect($locales)->toBeArray() |
76 | 76 | ->and($locales)->toHaveCount(2) |
|
80 | 80 | test('it throws exception for invalid locales configuration', function () { |
81 | 81 | Config::set('eclipse-common.available_locales', 'invalid'); |
82 | 82 |
|
83 | | - expect(fn () => Helper::getAvailable()) |
| 83 | + expect(fn () => Helper::getAvailableLocales()) |
84 | 84 | ->toThrow(InvalidConfigurationException::class, 'Configuration "eclipse-common.available_locales" must be an array or a callable that returns an array.'); |
85 | 85 | }); |
86 | 86 |
|
87 | 87 | test('it throws exception for empty locales configuration', function () { |
88 | 88 | Config::set('eclipse-common.available_locales', []); |
89 | 89 |
|
90 | | - expect(fn () => Helper::getAvailable()) |
| 90 | + expect(fn () => Helper::getAvailableLocales()) |
91 | 91 | ->toThrow(InvalidConfigurationException::class, 'Configuration "eclipse-common.available_locales" must contain at least one locale.'); |
92 | 92 | }); |
93 | 93 |
|
94 | 94 | test('it can get options for locales', function () { |
95 | 95 | Config::set('eclipse-common.available_locales', ['en', 'sl']); |
96 | 96 |
|
97 | | - $options = Helper::getOptions(); |
| 97 | + $options = Helper::getLocaleOptions(); |
98 | 98 |
|
99 | 99 | expect($options)->toBeArray() |
100 | 100 | ->and($options)->toHaveCount(2) |
|
0 commit comments