diff --git a/tests/Feature/Banking/AccountsTest.php b/tests/Feature/Banking/AccountsTest.php index 443e18bff..eca4ef278 100644 --- a/tests/Feature/Banking/AccountsTest.php +++ b/tests/Feature/Banking/AccountsTest.php @@ -73,18 +73,17 @@ class AccountsTest extends FeatureTestCase private function getAccountRequest() { - return[ - 'company_id' => $this->company->id, - 'name' => $this->faker->text(5), - 'number' => '1', - 'currency_code' => setting('general.default_currency'), - 'opening_balance' => 0, - 'bank_name' => $this->faker->text(5), - 'bank_phone' => null, - 'bank_address' => null, - 'default_account' => $this->faker->randomElement(['yes', 'no']), - 'enabled' => $this->faker->boolean ? 1 : 0, + return [ + 'company_id' => $this->company->id, + 'name' => $this->faker->text(5), + 'number' => '1', + 'currency_code' => setting('general.default_currency'), + 'opening_balance' => 0, + 'bank_name' => $this->faker->text(5), + 'bank_phone' => null, + 'bank_address' => null, + 'default_account' => $this->faker->randomElement(['yes', 'no']), + 'enabled' => $this->faker->boolean ? 1 : 0, ]; } } - diff --git a/tests/Feature/Banking/ReconciliationsTest.php b/tests/Feature/Banking/ReconciliationsTest.php index 43bcc09ec..853b542a5 100644 --- a/tests/Feature/Banking/ReconciliationsTest.php +++ b/tests/Feature/Banking/ReconciliationsTest.php @@ -1,6 +1,7 @@ '1', ]; } -} \ No newline at end of file +} diff --git a/tests/Feature/Banking/TransfersTest.php b/tests/Feature/Banking/TransfersTest.php index 5a70146b6..da3288ee0 100644 --- a/tests/Feature/Banking/TransfersTest.php +++ b/tests/Feature/Banking/TransfersTest.php @@ -120,7 +120,7 @@ class TransfersTest extends FeatureTestCase 'payment_method' => 'offlinepayment.cash.1', 'reference' => null, 'currency_code' => setting('general.default_currency'), - 'currency_rate' => '1', + 'currency_rate' => '1' ]; } @@ -140,7 +140,7 @@ class TransfersTest extends FeatureTestCase 'category_id' => $this->company->categories()->type('income')->first()->id, 'reference' => $this->faker->text(5), 'payment_method' => setting('general.default_payment_method'), - 'attachment' => $attachment, + 'attachment' => $attachment ]; } @@ -160,7 +160,7 @@ class TransfersTest extends FeatureTestCase 'category_id' => $this->company->categories()->type('expense')->first()->id, 'payment_method' => setting('general.default_payment_method'), 'reference' => $this->faker->text(5), - 'attachment' => $attachment, + 'attachment' => $attachment ]; } -} \ No newline at end of file +} diff --git a/tests/Feature/Commands/BillReminderTest.php b/tests/Feature/Commands/BillReminderTest.php index e3c4d4675..420b64b5f 100644 --- a/tests/Feature/Commands/BillReminderTest.php +++ b/tests/Feature/Commands/BillReminderTest.php @@ -50,7 +50,6 @@ class BillReminderTest extends FeatureTestCase $items = [['name' => $this->faker->text(5), 'item_id' => null, 'quantity' => '1', 'price' => $amount, 'currency' => 'USD']]; - $data = [ 'vendor_id' => '0', 'billed_at' => $this->faker->date(), @@ -74,7 +73,6 @@ class BillReminderTest extends FeatureTestCase 'company_id' => $this->company->id, ]; - return $data; } } diff --git a/tests/Feature/Commands/InvoiceReminderTest.php b/tests/Feature/Commands/InvoiceReminderTest.php index c890cb93f..6868309c2 100644 --- a/tests/Feature/Commands/InvoiceReminderTest.php +++ b/tests/Feature/Commands/InvoiceReminderTest.php @@ -50,7 +50,6 @@ class InvoiceReminderTest extends FeatureTestCase $items = [['name' => $this->faker->text(5), 'item_id' => null, 'quantity' => '1', 'price' => $amount, 'currency' => 'USD']]; - $data = [ 'customer_id' => '0', 'invoiced_at' => $this->faker->date(), diff --git a/tests/Feature/Common/DashboardTest.php b/tests/Feature/Common/DashboardTest.php index 5135f0975..698b8567e 100644 --- a/tests/Feature/Common/DashboardTest.php +++ b/tests/Feature/Common/DashboardTest.php @@ -13,4 +13,4 @@ class DashboardTest extends FeatureTestCase ->assertStatus(200) ->assertSeeText(trans('general.dashboard')); } -} \ No newline at end of file +} diff --git a/tests/Feature/Common/ItemsTest.php b/tests/Feature/Common/ItemsTest.php index 83946c4a9..dd61df936 100644 --- a/tests/Feature/Common/ItemsTest.php +++ b/tests/Feature/Common/ItemsTest.php @@ -90,4 +90,4 @@ class ItemsTest extends FeatureTestCase 'enabled' => $this->faker->boolean ? 1 : 0 ]; } -} \ No newline at end of file +} diff --git a/tests/Feature/Expenses/BillsTest.php b/tests/Feature/Expenses/BillsTest.php index 0ce38819e..96820c2f2 100644 --- a/tests/Feature/Expenses/BillsTest.php +++ b/tests/Feature/Expenses/BillsTest.php @@ -121,4 +121,4 @@ class BillsTest extends FeatureTestCase return $data; } -} \ No newline at end of file +} diff --git a/tests/Feature/Expenses/PaymentsTest.php b/tests/Feature/Expenses/PaymentsTest.php index 9a0300ac7..cde58f56f 100644 --- a/tests/Feature/Expenses/PaymentsTest.php +++ b/tests/Feature/Expenses/PaymentsTest.php @@ -8,7 +8,6 @@ use Tests\Feature\FeatureTestCase; class PaymentsTest extends FeatureTestCase { - public function testItShouldSeePaymentListPage() { $this->loginAs() @@ -82,5 +81,4 @@ class PaymentsTest extends FeatureTestCase 'attachment' => $attachment, ]; } - -} \ No newline at end of file +} diff --git a/tests/Feature/Expenses/VendorsTest.php b/tests/Feature/Expenses/VendorsTest.php index 9269f2a01..79a9a07e9 100644 --- a/tests/Feature/Expenses/VendorsTest.php +++ b/tests/Feature/Expenses/VendorsTest.php @@ -80,7 +80,6 @@ class VendorsTest extends FeatureTestCase ->assertRedirect(route('vendors.index')); $this->assertFlashLevel('success'); - } private function getVendorRequest() @@ -97,5 +96,4 @@ class VendorsTest extends FeatureTestCase 'enabled' => $this->faker->boolean ? 1 : 0 ]; } - -} \ No newline at end of file +} diff --git a/tests/Feature/FeatureTestCase.php b/tests/Feature/FeatureTestCase.php index 51a782b8d..994fed0b3 100644 --- a/tests/Feature/FeatureTestCase.php +++ b/tests/Feature/FeatureTestCase.php @@ -27,6 +27,11 @@ abstract class FeatureTestCase extends TestCase $this->faker = Factory::create(); $this->user = User::first(); $this->company = $this->user->first()->companies()->first(); + + // Set Company settings + setting()->forgetAll(); + setting()->setExtraColumns(['company_id' => $this->company->id]); + setting()->load(true); } /** @@ -44,7 +49,7 @@ abstract class FeatureTestCase extends TestCase if (!$company) { $company = $user->companies()->first(); - } + } $this->startSession(); diff --git a/tests/Feature/Incomes/CustomersTest.php b/tests/Feature/Incomes/CustomersTest.php index 42c6c240b..9df070b52 100644 --- a/tests/Feature/Incomes/CustomersTest.php +++ b/tests/Feature/Incomes/CustomersTest.php @@ -144,4 +144,4 @@ class CustomersTest extends FeatureTestCase 'password_confirmation' => $password ]; } -} \ No newline at end of file +} diff --git a/tests/Feature/Incomes/InvoicesTest.php b/tests/Feature/Incomes/InvoicesTest.php index 272270906..51332091d 100644 --- a/tests/Feature/Incomes/InvoicesTest.php +++ b/tests/Feature/Incomes/InvoicesTest.php @@ -58,7 +58,6 @@ class InvoicesTest extends FeatureTestCase ->assertStatus(302); $this->assertFlashLevel('success'); - } public function testItShouldDeleteInvoice() @@ -71,7 +70,6 @@ class InvoicesTest extends FeatureTestCase ->assertRedirect(url('incomes/invoices')); $this->assertFlashLevel('success'); - } private function getInvoiceRequest($recurring = 0) @@ -112,4 +110,4 @@ class InvoicesTest extends FeatureTestCase return $data; } -} \ No newline at end of file +} diff --git a/tests/Feature/Incomes/RevenuesTest.php b/tests/Feature/Incomes/RevenuesTest.php index 49ee10115..9284dfd07 100644 --- a/tests/Feature/Incomes/RevenuesTest.php +++ b/tests/Feature/Incomes/RevenuesTest.php @@ -81,4 +81,4 @@ class RevenuesTest extends FeatureTestCase 'attachment' => $attachment, ]; } -} \ No newline at end of file +} diff --git a/tests/Feature/Reports/ExpenseSummaryTest.php b/tests/Feature/Reports/ExpenseSummaryTest.php index 98fe5fbe1..f1197e9c4 100644 --- a/tests/Feature/Reports/ExpenseSummaryTest.php +++ b/tests/Feature/Reports/ExpenseSummaryTest.php @@ -13,4 +13,4 @@ class ExpenseSummaryTest extends FeatureTestCase ->assertStatus(200) ->assertSeeText(trans('reports.summary.expense')); } -} \ No newline at end of file +} diff --git a/tests/Feature/Reports/IncomeExpenseSumaryTest.php b/tests/Feature/Reports/IncomeExpenseSumaryTest.php index bfd3c17a0..ac9766307 100644 --- a/tests/Feature/Reports/IncomeExpenseSumaryTest.php +++ b/tests/Feature/Reports/IncomeExpenseSumaryTest.php @@ -13,4 +13,4 @@ class IncomeExpenseSummaryTest extends FeatureTestCase ->assertStatus(200) ->assertSeeText(trans('reports.summary.income_expense')); } -} \ No newline at end of file +} diff --git a/tests/Feature/Reports/IncomeSummaryTest.php b/tests/Feature/Reports/IncomeSummaryTest.php index 4e1805085..5adb7adf7 100644 --- a/tests/Feature/Reports/IncomeSummaryTest.php +++ b/tests/Feature/Reports/IncomeSummaryTest.php @@ -13,4 +13,4 @@ class IncomeSummaryTest extends FeatureTestCase ->assertStatus(200) ->assertSeeText(trans('reports.summary.income')); } -} \ No newline at end of file +} diff --git a/tests/Feature/Reports/ProfitLossTest.php b/tests/Feature/Reports/ProfitLossTest.php index 7d56d1c01..23c0a5c9d 100644 --- a/tests/Feature/Reports/ProfitLossTest.php +++ b/tests/Feature/Reports/ProfitLossTest.php @@ -13,4 +13,4 @@ class ProfitLossTest extends FeatureTestCase ->assertStatus(200) ->assertSeeText(trans('reports.profit_loss')); } -} \ No newline at end of file +} diff --git a/tests/Feature/Reports/TaxSummaryTest.php b/tests/Feature/Reports/TaxSummaryTest.php index a0613b3a0..526e489a7 100644 --- a/tests/Feature/Reports/TaxSummaryTest.php +++ b/tests/Feature/Reports/TaxSummaryTest.php @@ -13,4 +13,4 @@ class TaxSummaryTest extends FeatureTestCase ->assertStatus(200) ->assertSeeText(trans('reports.summary.tax')); } -} \ No newline at end of file +} diff --git a/tests/Feature/Settings/CategoriesTest.php b/tests/Feature/Settings/CategoriesTest.php index fd6e27fc5..799f71c78 100644 --- a/tests/Feature/Settings/CategoriesTest.php +++ b/tests/Feature/Settings/CategoriesTest.php @@ -81,4 +81,4 @@ class CategoriesTest extends FeatureTestCase 'enabled' => $this->faker->boolean ? 1 : 0 ]; } -} \ No newline at end of file +} diff --git a/tests/Feature/Settings/CurrenciesTest.php b/tests/Feature/Settings/CurrenciesTest.php index f2ab49132..8c6930ae0 100644 --- a/tests/Feature/Settings/CurrenciesTest.php +++ b/tests/Feature/Settings/CurrenciesTest.php @@ -7,7 +7,6 @@ use Tests\Feature\FeatureTestCase; class CurrenciesTest extends FeatureTestCase { - public function testItShouldSeeCurrencyListPage() { $this->loginAs() @@ -62,7 +61,6 @@ class CurrenciesTest extends FeatureTestCase $this->assertFlashLevel('success'); } - private function getCurrencyRequest() { return [ @@ -80,4 +78,4 @@ class CurrenciesTest extends FeatureTestCase 'default_currency' => $this->faker->boolean ? 1 : 0 ]; } -} \ No newline at end of file +} diff --git a/tests/Feature/Settings/TaxesTest.php b/tests/Feature/Settings/TaxesTest.php index e6b7dd4a2..a31a1a070 100644 --- a/tests/Feature/Settings/TaxesTest.php +++ b/tests/Feature/Settings/TaxesTest.php @@ -71,4 +71,4 @@ class TaxesTest extends FeatureTestCase 'enabled' => $this->faker->boolean ? 1 : 0 ]; } -} \ No newline at end of file +}