Skip to content

Commit

Permalink
Switch from annotations to prefix in unit tests to prepare for phpuni…
Browse files Browse the repository at this point in the history
…t12 deprecations
  • Loading branch information
patrickbrouwers committed Feb 19, 2024
1 parent 4f481f6 commit 27de9a7
Show file tree
Hide file tree
Showing 68 changed files with 634 additions and 634 deletions.
32 changes: 16 additions & 16 deletions tests/Cache/BatchCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class BatchCacheTest extends TestCase
private $memory;

/**
* @test
*
*/
public function will_get_multiple_from_memory_if_cells_hold_in_memory()
public function test_will_get_multiple_from_memory_if_cells_hold_in_memory()
{
$inMemory = [
'A1' => 'A1-value',
Expand All @@ -50,9 +50,9 @@ public function will_get_multiple_from_memory_if_cells_hold_in_memory()
}

/**
* @test
*
*/
public function will_get_multiple_from_cache_if_cells_are_persisted()
public function test_will_get_multiple_from_cache_if_cells_are_persisted()
{
$inMemory = [];
$persisted = [
Expand All @@ -72,9 +72,9 @@ public function will_get_multiple_from_cache_if_cells_are_persisted()
}

/**
* @test
*
*/
public function will_get_multiple_from_cache_and_persisted()
public function test_will_get_multiple_from_cache_and_persisted()
{
$inMemory = [
'A1' => 'A1-value',
Expand All @@ -99,9 +99,9 @@ public function will_get_multiple_from_cache_and_persisted()
}

/**
* @test
*
*/
public function it_persists_to_cache_when_memory_limit_reached_on_setting_a_value()
public function test_it_persists_to_cache_when_memory_limit_reached_on_setting_a_value()
{
$memoryLimit = 3;
$persisted = [];
Expand Down Expand Up @@ -137,9 +137,9 @@ public function it_persists_to_cache_when_memory_limit_reached_on_setting_a_valu
}

/**
* @test
*
*/
public function it_persists_to_cache_when_memory_limit_reached_on_setting_multiple_values()
public function test_it_persists_to_cache_when_memory_limit_reached_on_setting_multiple_values()
{
$memoryLimit = 3;
$persisted = [];
Expand Down Expand Up @@ -180,11 +180,11 @@ public function it_persists_to_cache_when_memory_limit_reached_on_setting_multip
}

/**
* @test
*
*
* @dataProvider defaultTTLDataProvider
*/
public function it_writes_to_cache_with_default_ttl($defaultTTL, $receivedAs)
public function test_it_writes_to_cache_with_default_ttl($defaultTTL, $receivedAs)
{
config()->set('excel.cache.default_ttl', $defaultTTL);

Expand All @@ -204,9 +204,9 @@ function (KeyWritten $event) use ($expectedTTL) {
}

/**
* @test
*
*/
public function it_writes_to_cache_with_a_dateinterval_ttl()
public function test_it_writes_to_cache_with_a_dateinterval_ttl()
{
// DateInterval is 1 minute
config()->set('excel.cache.default_ttl', new DateInterval('PT1M'));
Expand All @@ -225,9 +225,9 @@ function (KeyWritten $event) {
}

/**
* @test
*
*/
public function it_can_override_default_ttl()
public function test_it_can_override_default_ttl()
{
config()->set('excel.cache.default_ttl', 1);

Expand Down
12 changes: 6 additions & 6 deletions tests/CellTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
class CellTest extends TestCase
{
/**
* @test
*
*/
public function can_get_cell_value()
public function test_can_get_cell_value()
{
config()->set('excel.imports.cells.middleware', []);

Expand All @@ -24,9 +24,9 @@ public function can_get_cell_value()
}

/**
* @test
*
*/
public function can_trim_empty_cells()
public function test_can_trim_empty_cells()
{
config()->set('excel.imports.cells.middleware', [
TrimCellValue::class,
Expand All @@ -40,9 +40,9 @@ public function can_trim_empty_cells()
}

/**
* @test
*
*/
public function convert_empty_cells_to_null()
public function test_convert_empty_cells_to_null()
{
config()->set('excel.imports.cells.middleware', [
TrimCellValue::class,
Expand Down
64 changes: 32 additions & 32 deletions tests/Concerns/ExportableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
class ExportableTest extends TestCase
{
/**
* @test
*
*/
public function needs_to_have_a_file_name_when_downloading()
public function test_needs_to_have_a_file_name_when_downloading()
{
$this->expectException(\Maatwebsite\Excel\Exceptions\NoFilenameGivenException::class);
$this->expectExceptionMessage('A filename needs to be passed in order to download the export');
Expand All @@ -30,9 +30,9 @@ public function needs_to_have_a_file_name_when_downloading()
}

/**
* @test
*
*/
public function needs_to_have_a_file_name_when_storing()
public function test_needs_to_have_a_file_name_when_storing()
{
$this->expectException(\Maatwebsite\Excel\Exceptions\NoFilePathGivenException::class);
$this->expectExceptionMessage('A filepath needs to be passed in order to store the export');
Expand All @@ -46,9 +46,9 @@ public function needs_to_have_a_file_name_when_storing()
}

/**
* @test
*
*/
public function needs_to_have_a_file_name_when_queuing()
public function test_needs_to_have_a_file_name_when_queuing()
{
$this->expectException(\Maatwebsite\Excel\Exceptions\NoFilePathGivenException::class);
$this->expectExceptionMessage('A filepath needs to be passed in order to store the export');
Expand All @@ -62,9 +62,9 @@ public function needs_to_have_a_file_name_when_queuing()
}

/**
* @test
*
*/
public function responsable_needs_to_have_file_name_configured_inside_the_export()
public function test_responsable_needs_to_have_file_name_configured_inside_the_export()
{
$this->expectException(\Maatwebsite\Excel\Exceptions\NoFilenameGivenException::class);
$this->expectExceptionMessage('A filename needs to be passed in order to download the export');
Expand All @@ -78,9 +78,9 @@ public function responsable_needs_to_have_file_name_configured_inside_the_export
}

/**
* @test
*
*/
public function is_responsable()
public function test_is_responsable()
{
$export = new class implements Responsable
{
Expand All @@ -97,9 +97,9 @@ public function is_responsable()
}

/**
* @test
*
*/
public function can_have_customized_header()
public function test_can_have_customized_header()
{
$export = new class
{
Expand All @@ -116,9 +116,9 @@ public function can_have_customized_header()
}

/**
* @test
*
*/
public function can_set_custom_headers_in_export_class()
public function test_can_set_custom_headers_in_export_class()
{
$export = new class
{
Expand All @@ -136,9 +136,9 @@ public function can_set_custom_headers_in_export_class()
}

/**
* @test
*
*/
public function can_get_raw_export_contents()
public function test_can_get_raw_export_contents()
{
$export = new EmptyExport;

Expand All @@ -148,9 +148,9 @@ public function can_get_raw_export_contents()
}

/**
* @test
*
*/
public function can_have_customized_disk_options_when_storing()
public function test_can_have_customized_disk_options_when_storing()
{
$export = new EmptyExport;

Expand All @@ -162,9 +162,9 @@ public function can_have_customized_disk_options_when_storing()
}

/**
* @test
*
*/
public function can_have_customized_disk_options_when_queueing()
public function test_can_have_customized_disk_options_when_queueing()
{
$export = new EmptyExport;

Expand All @@ -176,9 +176,9 @@ public function can_have_customized_disk_options_when_queueing()
}

/**
* @test
*
*/
public function can_set_disk_options_in_export_class_when_storing()
public function test_can_set_disk_options_in_export_class_when_storing()
{
$export = new class
{
Expand All @@ -197,9 +197,9 @@ public function can_set_disk_options_in_export_class_when_storing()
}

/**
* @test
*
*/
public function can_set_disk_options_in_export_class_when_queuing()
public function test_can_set_disk_options_in_export_class_when_queuing()
{
$export = new class
{
Expand All @@ -218,9 +218,9 @@ public function can_set_disk_options_in_export_class_when_queuing()
}

/**
* @test
*
*/
public function can_override_export_class_disk_options_when_calling_store()
public function test_can_override_export_class_disk_options_when_calling_store()
{
$export = new class
{
Expand All @@ -237,9 +237,9 @@ public function can_override_export_class_disk_options_when_calling_store()
}

/**
* @test
*
*/
public function can_override_export_class_disk_options_when_calling_queue()
public function test_can_override_export_class_disk_options_when_calling_queue()
{
$export = new class
{
Expand All @@ -256,9 +256,9 @@ public function can_override_export_class_disk_options_when_calling_queue()
}

/**
* @test
*
*/
public function can_have_empty_disk_options_when_storing()
public function test_can_have_empty_disk_options_when_storing()
{
$export = new EmptyExport;

Expand All @@ -270,9 +270,9 @@ public function can_have_empty_disk_options_when_storing()
}

/**
* @test
*
*/
public function can_have_empty_disk_options_when_queueing()
public function test_can_have_empty_disk_options_when_queueing()
{
$export = new EmptyExport;

Expand Down
4 changes: 2 additions & 2 deletions tests/Concerns/FromArrayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
class FromArrayTest extends TestCase
{
/**
* @test
*
*/
public function can_export_from_array()
public function test_can_export_from_array()
{
$export = new class implements FromArray
{
Expand Down
16 changes: 8 additions & 8 deletions tests/Concerns/FromCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
class FromCollectionTest extends TestCase
{
/**
* @test
*
*/
public function can_export_from_collection()
public function test_can_export_from_collection()
{
$export = new SheetWith100Rows('A');

Expand All @@ -28,9 +28,9 @@ public function can_export_from_collection()
}

/**
* @test
*
*/
public function can_export_with_multiple_sheets_from_collection()
public function test_can_export_with_multiple_sheets_from_collection()
{
$export = new QueuedExport();

Expand All @@ -52,9 +52,9 @@ public function can_export_with_multiple_sheets_from_collection()
}

/**
* @test
*
*/
public function can_export_from_lazy_collection()
public function test_can_export_from_lazy_collection()
{
if (!class_exists('\Illuminate\Support\LazyCollection')) {
$this->markTestSkipped('Skipping test because LazyCollection is not supported');
Expand All @@ -79,9 +79,9 @@ function (array $item) {
}

/**
* @test
*
*/
public function can_export_from_lazy_collection_with_queue()
public function test_can_export_from_lazy_collection_with_queue()
{
if (!class_exists('\Illuminate\Support\LazyCollection')) {
$this->markTestSkipped('Skipping test because LazyCollection is not supported');
Expand Down
4 changes: 2 additions & 2 deletions tests/Concerns/FromGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
class FromGeneratorTest extends TestCase
{
/**
* @test
*
*/
public function can_export_from_generator()
public function test_can_export_from_generator()
{
$export = new class implements FromGenerator
{
Expand Down
Loading

0 comments on commit 27de9a7

Please sign in to comment.