Skip to content

Commit 177c05b

Browse files
committed
Remove test callback return types
1 parent 3ff68fb commit 177c05b

16 files changed

Lines changed: 87 additions & 87 deletions

tests/Integration/Console/FreshCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Symfony\Component\Console\Input\ArrayInput;
88
use Symfony\Component\Console\Output\NullOutput;
99

10-
it('drops indices and migrations', function (): void {
10+
it('drops indices and migrations', function () {
1111
$migrator = Mockery::mock(Migrator::class);
1212
$repository = Mockery::mock(MigrationRepository::class);
1313
$index = Mockery::mock(IndexManagerInterface::class);

tests/Integration/Console/MakeCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Symfony\Component\Console\Input\ArrayInput;
66
use Symfony\Component\Console\Output\BufferedOutput;
77

8-
it('creates migration files', function (): void {
8+
it('creates migration files', function () {
99
$migrations = Mockery::mock(MigrationStorage::class);
1010
app()->instance(MigrationStorage::class, $migrations);
1111

tests/Integration/Console/MigrateCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Symfony\Component\Console\Input\ArrayInput;
66
use Symfony\Component\Console\Output\NullOutput;
77

8-
it('runs one migration when a file name is provided', function (): void {
8+
it('runs one migration when a file name is provided', function () {
99
$migrator = Mockery::mock(Migrator::class);
1010
app()->instance(Migrator::class, $migrator);
1111

@@ -20,7 +20,7 @@
2020
expect($command->run(new ArrayInput(['--force' => true, 'fileName' => 'test_file_name']), new NullOutput))->toBe(0);
2121
});
2222

23-
it('runs all migrations when a file name is not provided', function (): void {
23+
it('runs all migrations when a file name is not provided', function () {
2424
$migrator = Mockery::mock(Migrator::class);
2525
app()->instance(Migrator::class, $migrator);
2626

tests/Integration/Console/RefreshCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Symfony\Component\Console\Input\ArrayInput;
66
use Symfony\Component\Console\Output\NullOutput;
77

8-
it('resets and reruns all migrations', function (): void {
8+
it('resets and reruns all migrations', function () {
99
$migrator = Mockery::mock(Migrator::class);
1010
app()->instance(Migrator::class, $migrator);
1111

tests/Integration/Console/ResetCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Symfony\Component\Console\Input\ArrayInput;
66
use Symfony\Component\Console\Output\NullOutput;
77

8-
it('rolls back all migrations', function (): void {
8+
it('rolls back all migrations', function () {
99
$migrator = Mockery::mock(Migrator::class);
1010
app()->instance(Migrator::class, $migrator);
1111

tests/Integration/Console/RollbackCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Symfony\Component\Console\Input\ArrayInput;
66
use Symfony\Component\Console\Output\NullOutput;
77

8-
it('rolls back one migration when a file name is provided', function (): void {
8+
it('rolls back one migration when a file name is provided', function () {
99
$migrator = Mockery::mock(Migrator::class);
1010
app()->instance(Migrator::class, $migrator);
1111

@@ -20,7 +20,7 @@
2020
expect($command->run(new ArrayInput(['--force' => true, 'fileName' => 'test_file_name']), new NullOutput))->toBe(0);
2121
});
2222

23-
it('rolls back the last batch when a file name is not provided', function (): void {
23+
it('rolls back the last batch when a file name is not provided', function () {
2424
$migrator = Mockery::mock(Migrator::class);
2525
app()->instance(Migrator::class, $migrator);
2626

tests/Integration/Console/StatusCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Symfony\Component\Console\Input\ArrayInput;
66
use Symfony\Component\Console\Output\NullOutput;
77

8-
it('shows migration status', function (): void {
8+
it('shows migration status', function () {
99
$migrator = Mockery::mock(Migrator::class);
1010
app()->instance(Migrator::class, $migrator);
1111

tests/Integration/Factories/MigrationFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use DirectoryTree\OpenSearchMigrations\Filesystem\MigrationStorage;
55
use DirectoryTree\OpenSearchMigrations\MigrationInterface;
66

7-
it('creates migrations from files', function (string $fileName): void {
7+
it('creates migrations from files', function (string $fileName) {
88
$file = resolve(MigrationStorage::class)->find($fileName);
99

1010
expect(resolve(MigrationFactory::class)->makeFromFile($file))->toBeInstanceOf(MigrationInterface::class);

tests/Integration/Filesystem/MigrationStorageTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use DirectoryTree\OpenSearchMigrations\Filesystem\MigrationFile;
44
use DirectoryTree\OpenSearchMigrations\Filesystem\MigrationStorage;
55

6-
it('creates files', function (): void {
6+
it('creates files', function () {
77
$storage = resolve(MigrationStorage::class);
88
$fileName = uniqid();
99

@@ -16,7 +16,7 @@
1616
@unlink($file->path());
1717
});
1818

19-
it('creates the directory along with the file', function (): void {
19+
it('creates the directory along with the file', function () {
2020
$directory = config('opensearch-migrations.storage_directory');
2121
$firstLevelDirectory = $directory.'/nested';
2222
$secondLevelDirectory = $firstLevelDirectory.'/directories';
@@ -33,15 +33,15 @@
3333
@rmdir($firstLevelDirectory);
3434
});
3535

36-
it('prepares when the directory exists', function (): void {
36+
it('prepares when the directory exists', function () {
3737
$directory = config('opensearch-migrations.storage_directory');
3838

3939
resolve(MigrationStorage::class)->prepare();
4040

4141
expect($directory)->toBeDirectory();
4242
});
4343

44-
it('creates the directory when preparing', function (): void {
44+
it('creates the directory when preparing', function () {
4545
$directory = sys_get_temp_dir().'/opensearch_migrations_missing_storage';
4646

4747
config()->set('opensearch-migrations.storage_directory', $directory);
@@ -53,7 +53,7 @@
5353
@rmdir($directory);
5454
});
5555

56-
it('finds existing files', function (string $fileName): void {
56+
it('finds existing files', function (string $fileName) {
5757
$file = resolve(MigrationStorage::class)->find($fileName);
5858

5959
expect($file)->toBeInstanceOf(MigrationFile::class);
@@ -65,7 +65,7 @@
6565
['2019_08_10_142230_update_test_index_mapping.php'],
6666
]);
6767

68-
it('does not find missing files', function (string $fileName): void {
68+
it('does not find missing files', function (string $fileName) {
6969
expect(resolve(MigrationStorage::class)->find($fileName))->toBeNull();
7070
})->with([
7171
['2020_12_01_081000_create_test_index'],
@@ -74,7 +74,7 @@
7474
['2020_08_10_142230_update_test_index_mapping.php'],
7575
]);
7676

77-
it('retrieves all migration files', function (): void {
77+
it('retrieves all migration files', function () {
7878
$files = resolve(MigrationStorage::class)->all();
7979

8080
expect($files->map(fn (MigrationFile $file) => $file->name())->toArray())->toBe([

tests/Integration/MigratorTest.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function outputExpectingLines(array $lines): OutputStyle
3434
return $output;
3535
}
3636

37-
it('does not run a missing single migration', function (): void {
37+
it('does not run a missing single migration', function () {
3838
$output = outputExpectingLines([
3939
'<error>Migration is not found:</error> 3020_11_01_045023_drop_test_index',
4040
]);
@@ -44,7 +44,7 @@ function outputExpectingLines(array $lines): OutputStyle
4444
expect($migrator->migrateOne('3020_11_01_045023_drop_test_index'))->toBe($migrator);
4545
});
4646

47-
it('runs a single migration when it exists', function (): void {
47+
it('runs a single migration when it exists', function () {
4848
Index::shouldReceive('putMapping')->once();
4949

5050
$output = outputExpectingLines([
@@ -61,7 +61,7 @@ function outputExpectingLines(array $lines): OutputStyle
6161
])->exists())->toBeTrue();
6262
});
6363

64-
it('does not run all migrations when the directory is empty', function (): void {
64+
it('does not run all migrations when the directory is empty', function () {
6565
$tmpDirectory = config('opensearch-migrations.storage_directory').'/tmp';
6666

6767
@mkdir($tmpDirectory);
@@ -78,7 +78,7 @@ function outputExpectingLines(array $lines): OutputStyle
7878
@rmdir($tmpDirectory);
7979
});
8080

81-
it('runs all outstanding migrations', function (): void {
81+
it('runs all outstanding migrations', function () {
8282
Index::shouldReceive('putMapping')->once();
8383

8484
$output = outputExpectingLines([
@@ -95,7 +95,7 @@ function outputExpectingLines(array $lines): OutputStyle
9595
])->exists())->toBeTrue();
9696
});
9797

98-
it('does not roll back a missing single migration', function (): void {
98+
it('does not roll back a missing single migration', function () {
9999
$output = outputExpectingLines([
100100
'<error>Migration is not found:</error> 3020_11_01_045023_drop_test_index',
101101
]);
@@ -105,7 +105,7 @@ function outputExpectingLines(array $lines): OutputStyle
105105
expect($migrator->rollbackOne('3020_11_01_045023_drop_test_index'))->toBe($migrator);
106106
});
107107

108-
it('does not roll back a migration that has not run', function (): void {
108+
it('does not roll back a migration that has not run', function () {
109109
$output = outputExpectingLines([
110110
'<error>Migration is not yet migrated:</error> 2019_08_10_142230_update_test_index_mapping',
111111
]);
@@ -115,7 +115,7 @@ function outputExpectingLines(array $lines): OutputStyle
115115
expect($migrator->rollbackOne('2019_08_10_142230_update_test_index_mapping'))->toBe($migrator);
116116
});
117117

118-
it('rolls back a migrated single migration', function (): void {
118+
it('rolls back a migrated single migration', function () {
119119
Index::shouldReceive('drop')->once();
120120

121121
$output = outputExpectingLines([
@@ -132,7 +132,7 @@ function outputExpectingLines(array $lines): OutputStyle
132132
])->exists())->toBeFalse();
133133
});
134134

135-
it('does not roll back the last batch when some files are missing', function (): void {
135+
it('does not roll back the last batch when some files are missing', function () {
136136
$output = outputExpectingLines([
137137
'<error>Migration is not found:</error> 2019_03_10_101500_create_test_index',
138138
]);
@@ -146,7 +146,7 @@ function outputExpectingLines(array $lines): OutputStyle
146146
expect($migrator->rollbackLastBatch())->toBe($migrator);
147147
});
148148

149-
it('rolls back the last batch when all files are present', function (): void {
149+
it('rolls back the last batch when all files are present', function () {
150150
Index::shouldReceive('putMapping')->once();
151151

152152
$output = outputExpectingLines([
@@ -167,7 +167,7 @@ function outputExpectingLines(array $lines): OutputStyle
167167
])->exists())->toBeFalse();
168168
});
169169

170-
it('does not roll back all migrations when some files are missing', function (): void {
170+
it('does not roll back all migrations when some files are missing', function () {
171171
$output = outputExpectingLines([
172172
'<error>Migration is not found:</error> 2019_03_10_101500_create_test_index,2019_01_01_053550_drop_test_index',
173173
]);
@@ -182,7 +182,7 @@ function outputExpectingLines(array $lines): OutputStyle
182182
expect($migrator->rollbackAll())->toBe($migrator);
183183
});
184184

185-
it('rolls back all migrations when all files are present', function (): void {
185+
it('rolls back all migrations when all files are present', function () {
186186
Index::shouldReceive('putMapping')->once();
187187
Index::shouldReceive('drop')->once();
188188

@@ -204,7 +204,7 @@ function outputExpectingLines(array $lines): OutputStyle
204204
expect(DB::table($table)->where('migration', '2018_12_01_081000_create_test_index')->exists())->toBeFalse();
205205
});
206206

207-
it('displays status', function (): void {
207+
it('displays status', function () {
208208
$output = Mockery::mock(OutputStyle::class);
209209

210210
$output->shouldReceive('table')->once()->with(
@@ -220,13 +220,13 @@ function outputExpectingLines(array $lines): OutputStyle
220220
expect($migrator->showStatus())->toBe($migrator);
221221
});
222222

223-
it('prepares the repository and storage', function (): void {
223+
it('prepares the repository and storage', function () {
224224
[, $migrator] = seededMigrator(Mockery::mock(OutputStyle::class));
225225

226226
expect($migrator->prepare())->toBe($migrator);
227227
});
228228

229-
it('creates the repository table when preparing', function (): void {
229+
it('creates the repository table when preparing', function () {
230230
$output = Mockery::mock(OutputStyle::class);
231231
[$table, $migrator] = seededMigrator($output);
232232

@@ -236,7 +236,7 @@ function outputExpectingLines(array $lines): OutputStyle
236236
expect(Schema::hasTable($table))->toBeTrue();
237237
});
238238

239-
it('creates the storage directory when preparing', function (): void {
239+
it('creates the storage directory when preparing', function () {
240240
$directory = sys_get_temp_dir().'/opensearch_migrations_missing_directory';
241241

242242
config()->set('opensearch-migrations.storage_directory', $directory);

0 commit comments

Comments
 (0)