From dcc714ff0c432ea53d5cf02e6d4dfacb82ea7a08 Mon Sep 17 00:00:00 2001 From: EnesSacid-Buker Date: Fri, 16 Dec 2022 10:36:57 +0300 Subject: [PATCH] Code refactoring (filename func arg2 already assigned by default) --- tests/Feature/Banking/TransactionsTest.php | 4 ++-- tests/Feature/Common/ItemsTest.php | 4 ++-- tests/Feature/Purchases/BillsTest.php | 4 ++-- tests/Feature/Purchases/VendorsTest.php | 4 ++-- tests/Feature/Sales/CustomersTest.php | 4 ++-- tests/Feature/Sales/InvoicesTest.php | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/Feature/Banking/TransactionsTest.php b/tests/Feature/Banking/TransactionsTest.php index eabe05ef6..2a644a890 100644 --- a/tests/Feature/Banking/TransactionsTest.php +++ b/tests/Feature/Banking/TransactionsTest.php @@ -129,7 +129,7 @@ class TransactionsTest extends FeatureTestCase Excel::matchByRegex(); Excel::assertDownloaded( - '/' . str()->filename(trans_choice('general.transactions', 2), '-') . '-\d{10}\.xlsx/', + '/' . str()->filename(trans_choice('general.transactions', 2)) . '-\d{10}\.xlsx/', function (Export $export) use ($count) { // Assert that the correct export is downloaded. return $export->collection()->count() === $count; @@ -156,7 +156,7 @@ class TransactionsTest extends FeatureTestCase Excel::matchByRegex(); Excel::assertDownloaded( - '/' . str()->filename(trans_choice('general.transactions', 2), '-') . '-\d{10}\.xlsx/', + '/' . str()->filename(trans_choice('general.transactions', 2)) . '-\d{10}\.xlsx/', function (Export $export) use ($select_count) { return $export->collection()->count() === $select_count; } diff --git a/tests/Feature/Common/ItemsTest.php b/tests/Feature/Common/ItemsTest.php index d1038b589..c1338b3d9 100644 --- a/tests/Feature/Common/ItemsTest.php +++ b/tests/Feature/Common/ItemsTest.php @@ -100,7 +100,7 @@ class ItemsTest extends FeatureTestCase Excel::matchByRegex(); Excel::assertDownloaded( - '/' . str()->filename(trans_choice('general.items', 2), '-') . '-\d{10}\.xlsx/', + '/' . str()->filename(trans_choice('general.items', 2)) . '-\d{10}\.xlsx/', function (Export $export) use ($count) { // Assert that the correct export is downloaded. return $export->sheets()[0]->collection()->count() === $count; @@ -127,7 +127,7 @@ class ItemsTest extends FeatureTestCase Excel::matchByRegex(); Excel::assertDownloaded( - '/' . str()->filename(trans_choice('general.items', 2), '-') . '-\d{10}\.xlsx/', + '/' . str()->filename(trans_choice('general.items', 2)) . '-\d{10}\.xlsx/', function (Export $export) use ($select_count) { // Assert that the correct export is downloaded. return $export->sheets()[0]->collection()->count() === $select_count; diff --git a/tests/Feature/Purchases/BillsTest.php b/tests/Feature/Purchases/BillsTest.php index 050b20d25..bd03a11ba 100644 --- a/tests/Feature/Purchases/BillsTest.php +++ b/tests/Feature/Purchases/BillsTest.php @@ -180,7 +180,7 @@ class BillsTest extends FeatureTestCase Excel::matchByRegex(); Excel::assertDownloaded( - '/' . str()->filename(trans_choice('general.bills', 2), '-') . '-\d{10}\.xlsx/', + '/' . str()->filename(trans_choice('general.bills', 2)) . '-\d{10}\.xlsx/', function (Export $export) use ($count) { // Assert that the correct export is downloaded. return $export->sheets()[0]->collection()->count() === $count; @@ -207,7 +207,7 @@ class BillsTest extends FeatureTestCase Excel::matchByRegex(); Excel::assertDownloaded( - '/' . str()->filename(trans_choice('general.bills', 2), '-') . '-\d{10}\.xlsx/', + '/' . str()->filename(trans_choice('general.bills', 2)) . '-\d{10}\.xlsx/', function (Export $export) use ($select_count) { return $export->sheets()[0]->collection()->count() === $select_count; } diff --git a/tests/Feature/Purchases/VendorsTest.php b/tests/Feature/Purchases/VendorsTest.php index 19f2acb58..ed651ccd8 100644 --- a/tests/Feature/Purchases/VendorsTest.php +++ b/tests/Feature/Purchases/VendorsTest.php @@ -126,7 +126,7 @@ class VendorsTest extends FeatureTestCase Excel::matchByRegex(); Excel::assertDownloaded( - '/' . str()->filename(trans_choice('general.vendors', 2), '-') . '-\d{10}\.xlsx/', + '/' . str()->filename(trans_choice('general.vendors', 2)) . '-\d{10}\.xlsx/', function (Export $export) use ($count) { // Assert that the correct export is downloaded. return $export->collection()->count() === $count; @@ -153,7 +153,7 @@ class VendorsTest extends FeatureTestCase Excel::matchByRegex(); Excel::assertDownloaded( - '/' . str()->filename(trans_choice('general.vendors', 2), '-') . '-\d{10}\.xlsx/', + '/' . str()->filename(trans_choice('general.vendors', 2)) . '-\d{10}\.xlsx/', function (Export $export) use ($select_count) { return $export->collection()->count() === $select_count; } diff --git a/tests/Feature/Sales/CustomersTest.php b/tests/Feature/Sales/CustomersTest.php index 965d07039..5864dc60d 100644 --- a/tests/Feature/Sales/CustomersTest.php +++ b/tests/Feature/Sales/CustomersTest.php @@ -147,7 +147,7 @@ class CustomersTest extends FeatureTestCase Excel::matchByRegex(); Excel::assertDownloaded( - '/' . str()->filename(trans_choice('general.customers', 2), '-') . '-\d{10}\.xlsx/', + '/' . str()->filename(trans_choice('general.customers', 2)) . '-\d{10}\.xlsx/', function (Export $export) use ($count) { // Assert that the correct export is downloaded. return $export->collection()->count() === $count; @@ -174,7 +174,7 @@ class CustomersTest extends FeatureTestCase Excel::matchByRegex(); Excel::assertDownloaded( - '/' . str()->filename(trans_choice('general.customers', 2), '-') . '-\d{10}\.xlsx/', + '/' . str()->filename(trans_choice('general.customers', 2)) . '-\d{10}\.xlsx/', function (Export $export) use ($select_count) { return $export->collection()->count() === $select_count; } diff --git a/tests/Feature/Sales/InvoicesTest.php b/tests/Feature/Sales/InvoicesTest.php index 095824a72..5fb575024 100644 --- a/tests/Feature/Sales/InvoicesTest.php +++ b/tests/Feature/Sales/InvoicesTest.php @@ -191,7 +191,7 @@ class InvoicesTest extends FeatureTestCase Excel::matchByRegex(); Excel::assertDownloaded( - '/' . str()->filename(trans_choice('general.invoices', 2), '-') . '-\d{10}\.xlsx/', + '/' . str()->filename(trans_choice('general.invoices', 2)) . '-\d{10}\.xlsx/', function (Export $export) use ($count) { // Assert that the correct export is downloaded. return $export->sheets()[0]->collection()->count() === $count; @@ -218,7 +218,7 @@ class InvoicesTest extends FeatureTestCase Excel::matchByRegex(); Excel::assertDownloaded( - '/' . str()->filename(trans_choice('general.invoices', 2), '-') . '-\d{10}\.xlsx/', + '/' . str()->filename(trans_choice('general.invoices', 2)) . '-\d{10}\.xlsx/', function (Export $export) use ($select_count) { return $export->sheets()[0]->collection()->count() === $select_count; }