Reviewed all tests for Travis

This commit is contained in:
Batuhan Baş 2019-04-02 18:51:06 +03:00
parent e6560f88a6
commit 9e0cdec575
22 changed files with 39 additions and 45 deletions

View File

@ -73,18 +73,17 @@ class AccountsTest extends FeatureTestCase
private function getAccountRequest() private function getAccountRequest()
{ {
return[ return [
'company_id' => $this->company->id, 'company_id' => $this->company->id,
'name' => $this->faker->text(5), 'name' => $this->faker->text(5),
'number' => '1', 'number' => '1',
'currency_code' => setting('general.default_currency'), 'currency_code' => setting('general.default_currency'),
'opening_balance' => 0, 'opening_balance' => 0,
'bank_name' => $this->faker->text(5), 'bank_name' => $this->faker->text(5),
'bank_phone' => null, 'bank_phone' => null,
'bank_address' => null, 'bank_address' => null,
'default_account' => $this->faker->randomElement(['yes', 'no']), 'default_account' => $this->faker->randomElement(['yes', 'no']),
'enabled' => $this->faker->boolean ? 1 : 0, 'enabled' => $this->faker->boolean ? 1 : 0,
]; ];
} }
} }

View File

@ -1,6 +1,7 @@
<?php <?php
namespace Tests\Feature\Banking; namespace Tests\Feature\Banking;
use App\Models\Banking\Reconciliation; use App\Models\Banking\Reconciliation;
use Tests\Feature\FeatureTestCase; use Tests\Feature\FeatureTestCase;

View File

@ -120,7 +120,7 @@ class TransfersTest extends FeatureTestCase
'payment_method' => 'offlinepayment.cash.1', 'payment_method' => 'offlinepayment.cash.1',
'reference' => null, 'reference' => null,
'currency_code' => setting('general.default_currency'), '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, 'category_id' => $this->company->categories()->type('income')->first()->id,
'reference' => $this->faker->text(5), 'reference' => $this->faker->text(5),
'payment_method' => setting('general.default_payment_method'), '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, 'category_id' => $this->company->categories()->type('expense')->first()->id,
'payment_method' => setting('general.default_payment_method'), 'payment_method' => setting('general.default_payment_method'),
'reference' => $this->faker->text(5), 'reference' => $this->faker->text(5),
'attachment' => $attachment, 'attachment' => $attachment
]; ];
} }
} }

View File

@ -50,7 +50,6 @@ class BillReminderTest extends FeatureTestCase
$items = [['name' => $this->faker->text(5), 'item_id' => null, 'quantity' => '1', 'price' => $amount, 'currency' => 'USD']]; $items = [['name' => $this->faker->text(5), 'item_id' => null, 'quantity' => '1', 'price' => $amount, 'currency' => 'USD']];
$data = [ $data = [
'vendor_id' => '0', 'vendor_id' => '0',
'billed_at' => $this->faker->date(), 'billed_at' => $this->faker->date(),
@ -74,7 +73,6 @@ class BillReminderTest extends FeatureTestCase
'company_id' => $this->company->id, 'company_id' => $this->company->id,
]; ];
return $data; return $data;
} }
} }

View File

@ -50,7 +50,6 @@ class InvoiceReminderTest extends FeatureTestCase
$items = [['name' => $this->faker->text(5), 'item_id' => null, 'quantity' => '1', 'price' => $amount, 'currency' => 'USD']]; $items = [['name' => $this->faker->text(5), 'item_id' => null, 'quantity' => '1', 'price' => $amount, 'currency' => 'USD']];
$data = [ $data = [
'customer_id' => '0', 'customer_id' => '0',
'invoiced_at' => $this->faker->date(), 'invoiced_at' => $this->faker->date(),

View File

@ -8,7 +8,6 @@ use Tests\Feature\FeatureTestCase;
class PaymentsTest extends FeatureTestCase class PaymentsTest extends FeatureTestCase
{ {
public function testItShouldSeePaymentListPage() public function testItShouldSeePaymentListPage()
{ {
$this->loginAs() $this->loginAs()
@ -82,5 +81,4 @@ class PaymentsTest extends FeatureTestCase
'attachment' => $attachment, 'attachment' => $attachment,
]; ];
} }
} }

View File

@ -80,7 +80,6 @@ class VendorsTest extends FeatureTestCase
->assertRedirect(route('vendors.index')); ->assertRedirect(route('vendors.index'));
$this->assertFlashLevel('success'); $this->assertFlashLevel('success');
} }
private function getVendorRequest() private function getVendorRequest()
@ -97,5 +96,4 @@ class VendorsTest extends FeatureTestCase
'enabled' => $this->faker->boolean ? 1 : 0 'enabled' => $this->faker->boolean ? 1 : 0
]; ];
} }
} }

View File

@ -27,6 +27,11 @@ abstract class FeatureTestCase extends TestCase
$this->faker = Factory::create(); $this->faker = Factory::create();
$this->user = User::first(); $this->user = User::first();
$this->company = $this->user->first()->companies()->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) { if (!$company) {
$company = $user->companies()->first(); $company = $user->companies()->first();
} }
$this->startSession(); $this->startSession();

View File

@ -58,7 +58,6 @@ class InvoicesTest extends FeatureTestCase
->assertStatus(302); ->assertStatus(302);
$this->assertFlashLevel('success'); $this->assertFlashLevel('success');
} }
public function testItShouldDeleteInvoice() public function testItShouldDeleteInvoice()
@ -71,7 +70,6 @@ class InvoicesTest extends FeatureTestCase
->assertRedirect(url('incomes/invoices')); ->assertRedirect(url('incomes/invoices'));
$this->assertFlashLevel('success'); $this->assertFlashLevel('success');
} }
private function getInvoiceRequest($recurring = 0) private function getInvoiceRequest($recurring = 0)

View File

@ -7,7 +7,6 @@ use Tests\Feature\FeatureTestCase;
class CurrenciesTest extends FeatureTestCase class CurrenciesTest extends FeatureTestCase
{ {
public function testItShouldSeeCurrencyListPage() public function testItShouldSeeCurrencyListPage()
{ {
$this->loginAs() $this->loginAs()
@ -62,7 +61,6 @@ class CurrenciesTest extends FeatureTestCase
$this->assertFlashLevel('success'); $this->assertFlashLevel('success');
} }
private function getCurrencyRequest() private function getCurrencyRequest()
{ {
return [ return [