mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
PHP CS Fixer
This commit is contained in:
parent
74411da11f
commit
8160af4ef4
@ -26,7 +26,7 @@ class ActivityApiTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -26,7 +26,7 @@ class ApplePayDomainMerchantUrlTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -43,12 +43,12 @@ class ApplePayDomainMerchantUrlTest extends TestCase
|
||||
$this->markTestSkipped('Skip test no company gateways installed');
|
||||
// }
|
||||
|
||||
$config = new \stdClass;
|
||||
$config = new \stdClass();
|
||||
$config->publishableKey = 'pk_test';
|
||||
$config->apiKey = 'sk_test';
|
||||
$config->appleDomainVerification = 'merchant_id';
|
||||
|
||||
$cg = new CompanyGateway;
|
||||
$cg = new CompanyGateway();
|
||||
$cg->company_id = $this->company->id;
|
||||
$cg->user_id = $this->user->id;
|
||||
$cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23';
|
||||
|
@ -26,7 +26,7 @@ class BankTransactionRuleTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -154,7 +154,7 @@ class BankTransactionRuleTest extends TestCase
|
||||
'applies_to' => 'DEBIT',
|
||||
'client_id' => $this->client->id,
|
||||
'vendor_id' => $this->vendor->id,
|
||||
'category_id' =>$this->expense_category->id,
|
||||
'category_id' => $this->expense_category->id,
|
||||
'rules' => [
|
||||
[
|
||||
'search_key' => 'description',
|
||||
@ -268,7 +268,7 @@ class BankTransactionRuleTest extends TestCase
|
||||
|
||||
$this->assertNotNull($bt->expense_id);
|
||||
|
||||
$bt=null;
|
||||
$bt = null;
|
||||
}
|
||||
|
||||
|
||||
|
@ -29,7 +29,7 @@ class BankTransactionTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -23,7 +23,7 @@ class YodleeBankTransactionTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -30,7 +30,7 @@ class BankIntegrationApiTest extends TestCase
|
||||
|
||||
protected $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -33,7 +33,7 @@ class BankTransactionApiTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -28,7 +28,7 @@ class BankTransactionRuleApiTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -104,7 +104,7 @@ class BaseApiTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -161,7 +161,7 @@ class BaseApiTest extends TestCase
|
||||
|
||||
$user_id = $owner_user->id;
|
||||
|
||||
$company_token = new CompanyToken;
|
||||
$company_token = new CompanyToken();
|
||||
$company_token->user_id = $owner_user->id;
|
||||
$company_token->company_id = $company->id;
|
||||
$company_token->account_id = $this->account->id;
|
||||
@ -186,7 +186,7 @@ class BaseApiTest extends TestCase
|
||||
|
||||
$this->low_token = \Illuminate\Support\Str::random(64);
|
||||
|
||||
$company_token = new CompanyToken;
|
||||
$company_token = new CompanyToken();
|
||||
$company_token->user_id = $lower_permission_user->id;
|
||||
$company_token->company_id = $this->company->id;
|
||||
$company_token->account_id = $this->account->id;
|
||||
@ -326,7 +326,7 @@ class BaseApiTest extends TestCase
|
||||
'company_id' => $company->id,
|
||||
]);
|
||||
|
||||
$gs = new GroupSetting;
|
||||
$gs = new GroupSetting();
|
||||
$gs->name = 'Test';
|
||||
$gs->company_id = $client->company_id;
|
||||
$gs->settings = ClientSettings::buildClientSettings($company->settings, $client->settings);
|
||||
@ -372,7 +372,7 @@ class BaseApiTest extends TestCase
|
||||
'company_id' => $company->id,
|
||||
]);
|
||||
|
||||
$cg = new CompanyGateway;
|
||||
$cg = new CompanyGateway();
|
||||
$cg->company_id = $company->id;
|
||||
$cg->user_id = $user_id;
|
||||
$cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23';
|
||||
|
@ -29,7 +29,7 @@ class CancelInvoiceTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -25,7 +25,7 @@ class ClassificationTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockUnitData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -46,7 +46,7 @@ class ClientApiTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -223,7 +223,7 @@ class ClientApiTest extends TestCase
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->postJson("/api/v1/clients/",$data)
|
||||
])->postJson("/api/v1/clients/", $data)
|
||||
->assertStatus(200);
|
||||
|
||||
$arr = $response->json();
|
||||
@ -274,7 +274,7 @@ class ClientApiTest extends TestCase
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->putJson("/api/v1/clients/".$this->client->hashed_id,$data)
|
||||
])->putJson("/api/v1/clients/".$this->client->hashed_id, $data)
|
||||
->assertStatus(200);
|
||||
|
||||
$arr = $response->json();
|
||||
@ -292,7 +292,7 @@ class ClientApiTest extends TestCase
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->putJson("/api/v1/clients/".$this->client->hashed_id,$data)
|
||||
])->putJson("/api/v1/clients/".$this->client->hashed_id, $data)
|
||||
->assertStatus(422);
|
||||
|
||||
}
|
||||
@ -307,7 +307,7 @@ class ClientApiTest extends TestCase
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->postJson("/api/v1/clients/",$data)
|
||||
])->postJson("/api/v1/clients/", $data)
|
||||
->assertStatus(422);
|
||||
|
||||
}
|
||||
@ -322,7 +322,7 @@ class ClientApiTest extends TestCase
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->postJson("/api/v1/clients/",$data)
|
||||
])->postJson("/api/v1/clients/", $data)
|
||||
->assertStatus(200);
|
||||
|
||||
$arr = $response->json();
|
||||
@ -342,7 +342,7 @@ class ClientApiTest extends TestCase
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->postJson("/api/v1/clients/",$data)
|
||||
])->postJson("/api/v1/clients/", $data)
|
||||
->assertStatus(200);
|
||||
|
||||
$arr = $response->json();
|
||||
@ -362,7 +362,7 @@ class ClientApiTest extends TestCase
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->putJson("/api/v1/clients/".$this->client->hashed_id,$data)
|
||||
])->putJson("/api/v1/clients/".$this->client->hashed_id, $data)
|
||||
->assertStatus(200);
|
||||
|
||||
$arr = $response->json();
|
||||
@ -382,7 +382,7 @@ class ClientApiTest extends TestCase
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->putJson("/api/v1/clients/".$this->client->hashed_id,$data)
|
||||
])->putJson("/api/v1/clients/".$this->client->hashed_id, $data)
|
||||
->assertStatus(200);
|
||||
|
||||
$arr = $response->json();
|
||||
@ -402,7 +402,7 @@ class ClientApiTest extends TestCase
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->putJson("/api/v1/clients/".$this->client->hashed_id,$data)
|
||||
])->putJson("/api/v1/clients/".$this->client->hashed_id, $data)
|
||||
->assertStatus(200);
|
||||
|
||||
$arr = $response->json();
|
||||
@ -422,7 +422,7 @@ class ClientApiTest extends TestCase
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->putJson("/api/v1/clients/".$this->client->hashed_id,$data)
|
||||
])->putJson("/api/v1/clients/".$this->client->hashed_id, $data)
|
||||
->assertStatus(422);
|
||||
|
||||
$arr = $response->json();
|
||||
@ -442,7 +442,7 @@ class ClientApiTest extends TestCase
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->postJson("/api/v1/clients",$data)
|
||||
])->postJson("/api/v1/clients", $data)
|
||||
->assertStatus(422);
|
||||
|
||||
$arr = $response->json();
|
||||
@ -462,7 +462,7 @@ class ClientApiTest extends TestCase
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->postJson("/api/v1/clients",$data)
|
||||
])->postJson("/api/v1/clients", $data)
|
||||
->assertStatus(200);
|
||||
|
||||
$arr = $response->json();
|
||||
@ -480,7 +480,7 @@ class ClientApiTest extends TestCase
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->postJson("/api/v1/clients",$data)
|
||||
])->postJson("/api/v1/clients", $data)
|
||||
->assertStatus(200);
|
||||
|
||||
$arr = $response->json();
|
||||
@ -498,7 +498,7 @@ class ClientApiTest extends TestCase
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->postJson("/api/v1/clients",$data)
|
||||
])->postJson("/api/v1/clients", $data)
|
||||
->assertStatus(200);
|
||||
|
||||
}
|
||||
@ -675,29 +675,29 @@ class ClientApiTest extends TestCase
|
||||
$this->assertCount(6, $arr['data']);
|
||||
|
||||
|
||||
$d = \App\Models\Document::factory()->create([
|
||||
$d = \App\Models\Document::factory()->create([
|
||||
'company_id' => $this->company->id,
|
||||
'user_id' => $this->user->id,
|
||||
]);
|
||||
]);
|
||||
|
||||
|
||||
$t = \App\Models\Task::factory()->create([
|
||||
$t = \App\Models\Task::factory()->create([
|
||||
'company_id' => $this->company->id,
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $this->client->id,
|
||||
]);
|
||||
]);
|
||||
|
||||
|
||||
$t->documents()->save($d);
|
||||
$t->documents()->save($d);
|
||||
|
||||
$response = $this->withHeaders([
|
||||
$response = $this->withHeaders([
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->postJson("/api/v1/clients/{$this->client->hashed_id}/documents")
|
||||
->assertStatus(200);
|
||||
])->postJson("/api/v1/clients/{$this->client->hashed_id}/documents")
|
||||
->assertStatus(200);
|
||||
|
||||
$arr = $response->json();
|
||||
$arr = $response->json();
|
||||
|
||||
$this->assertCount(7, $arr['data']);
|
||||
$this->assertCount(7, $arr['data']);
|
||||
|
||||
|
||||
|
||||
@ -733,7 +733,7 @@ $this->assertCount(7, $arr['data']);
|
||||
|
||||
$different_company_token = \Illuminate\Support\Str::random(64);
|
||||
|
||||
$company_token = new CompanyToken;
|
||||
$company_token = new CompanyToken();
|
||||
$company_token->user_id = $user->id;
|
||||
$company_token->company_id = $company->id;
|
||||
$company_token->account_id = $account->id;
|
||||
@ -931,7 +931,7 @@ $this->assertCount(7, $arr['data']);
|
||||
|
||||
public function testClientSettingsSave()
|
||||
{
|
||||
$std = new \stdClass;
|
||||
$std = new \stdClass();
|
||||
$std->entity = 'App\\Models\\Client';
|
||||
$std->currency_id = 3;
|
||||
|
||||
@ -945,7 +945,7 @@ $this->assertCount(7, $arr['data']);
|
||||
|
||||
public function testClientSettingsSave2()
|
||||
{
|
||||
$std = new \stdClass;
|
||||
$std = new \stdClass();
|
||||
$std->entity = 'App\\Models\\Client';
|
||||
$std->industry_id = '';
|
||||
$std->size_id = '';
|
||||
@ -1022,7 +1022,7 @@ $this->assertCount(7, $arr['data']);
|
||||
$repository = app()->make($repository_name);
|
||||
$repository->import_mode = true;
|
||||
|
||||
$_syn_request_class = new $request_name;
|
||||
$_syn_request_class = new $request_name();
|
||||
$_syn_request_class->setContainer(app());
|
||||
$_syn_request_class->initialize($data);
|
||||
$_syn_request_class->prepareForValidation();
|
||||
|
@ -29,7 +29,7 @@ class ClientDeletedInvoiceCreationTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -33,7 +33,7 @@ class ClientGatewayTokenApiTest extends TestCase
|
||||
protected $faker;
|
||||
protected CompanyGateway $cg;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -87,7 +87,7 @@ class ClientGatewayTokenApiTest extends TestCase
|
||||
//disable ach here
|
||||
$json_config = json_decode(config('ninja.testvars.stripe'));
|
||||
|
||||
$this->cg = new CompanyGateway;
|
||||
$this->cg = new CompanyGateway();
|
||||
$this->cg->company_id = $this->company->id;
|
||||
$this->cg->user_id = $this->user->id;
|
||||
$this->cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23';
|
||||
|
@ -27,7 +27,7 @@ class ClientModelTest extends TestCase
|
||||
use MockAccountData;
|
||||
use DatabaseTransactions;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -41,8 +41,9 @@ class ClientModelTest extends TestCase
|
||||
$this->markTestSkipped('Skip test no company gateways installed');
|
||||
}
|
||||
|
||||
if(CompanyGateway::count() == 0)
|
||||
if(CompanyGateway::count() == 0) {
|
||||
$this->markTestSkipped('Skip test no company gateways installed');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -51,7 +52,7 @@ class ClientModelTest extends TestCase
|
||||
|
||||
$this->invoice->amount = 10;
|
||||
$this->invoice->balance = 10;
|
||||
$this->invoice->status_id=2;
|
||||
$this->invoice->status_id = 2;
|
||||
$this->invoice->date = now()->subDays(2);
|
||||
$this->invoice->due_date = now()->addDays(2);
|
||||
$this->invoice->save();
|
||||
@ -106,7 +107,7 @@ class ClientModelTest extends TestCase
|
||||
$response->assertStatus(200);
|
||||
$arr = $response->json();
|
||||
|
||||
$this->assertEquals($invoice_count+2, count($arr['data']));
|
||||
$this->assertEquals($invoice_count + 2, count($arr['data']));
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'X-API-SECRET' => config('ninja.api_secret'),
|
||||
|
@ -25,9 +25,10 @@ use App\Utils\Traits\AppSetup;
|
||||
use Faker\Factory;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Livewire\Livewire;
|
||||
use function now;
|
||||
use Tests\TestCase;
|
||||
|
||||
use function now;
|
||||
|
||||
class CreditsTest extends TestCase
|
||||
{
|
||||
use DatabaseTransactions;
|
||||
|
@ -24,7 +24,7 @@ class ClientPresenterTest extends TestCase
|
||||
use MockAccountData;
|
||||
use DatabaseTransactions;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -50,7 +50,7 @@ class ClientTest extends TestCase
|
||||
|
||||
public $client_id;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -105,7 +105,7 @@ class ClientTest extends TestCase
|
||||
$this->assertEquals($gs->id, $c->group_settings_id);
|
||||
});
|
||||
|
||||
foreach($arr['data'] as $client_response){
|
||||
foreach($arr['data'] as $client_response) {
|
||||
|
||||
$this->assertEquals($gs->hashed_id, $client_response['group_settings_id']);
|
||||
}
|
||||
@ -128,14 +128,14 @@ class ClientTest extends TestCase
|
||||
|
||||
$this->company->saveSettings($settings, $this->company);
|
||||
|
||||
$client_exchange_rate = round($c->setExchangeRate(),2);
|
||||
$client_exchange_rate = round($c->setExchangeRate(), 2);
|
||||
|
||||
$aud_currency = Currency::find(12);
|
||||
$eur_currency = Currency::find(3);
|
||||
|
||||
$synthetic_exchange = $aud_currency->exchange_rate / $eur_currency->exchange_rate;
|
||||
|
||||
$this->assertEquals($client_exchange_rate, round($synthetic_exchange,2));
|
||||
$this->assertEquals($client_exchange_rate, round($synthetic_exchange, 2));
|
||||
|
||||
}
|
||||
|
||||
@ -254,7 +254,7 @@ class ClientTest extends TestCase
|
||||
{
|
||||
$line_items = [];
|
||||
|
||||
for ($x=0; $x<$number; $x++) {
|
||||
for ($x = 0; $x < $number; $x++) {
|
||||
$item = InvoiceItemFactory::create();
|
||||
$item->quantity = 1;
|
||||
$item->cost = 10;
|
||||
@ -570,7 +570,7 @@ class ClientTest extends TestCase
|
||||
'is_locked' => 0,
|
||||
]);
|
||||
|
||||
$company_token = new CompanyToken;
|
||||
$company_token = new CompanyToken();
|
||||
$company_token->user_id = $user->id;
|
||||
$company_token->company_id = $company->id;
|
||||
$company_token->account_id = $account->id;
|
||||
@ -625,7 +625,7 @@ class ClientTest extends TestCase
|
||||
'is_locked' => 0,
|
||||
]);
|
||||
|
||||
$company_token = new CompanyToken;
|
||||
$company_token = new CompanyToken();
|
||||
$company_token->user_id = $user->id;
|
||||
$company_token->company_id = $company->id;
|
||||
$company_token->account_id = $account->id;
|
||||
|
@ -34,7 +34,7 @@ class CompanyGatewayApiTest extends TestCase
|
||||
use MockAccountData;
|
||||
use CompanyGatewayFeesAndLimitsSaver;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -164,7 +164,7 @@ class CompanyGatewayApiTest extends TestCase
|
||||
|
||||
public function testCompanyGatewayFeesAndLimitsSuccess()
|
||||
{
|
||||
$fee = new FeesAndLimits;
|
||||
$fee = new FeesAndLimits();
|
||||
|
||||
$fee = (array) $fee;
|
||||
|
||||
@ -224,7 +224,7 @@ class CompanyGatewayApiTest extends TestCase
|
||||
|
||||
public function testCompanyGatewayFeesAndLimitsFails()
|
||||
{
|
||||
$fee_and_limit['bank_transfer'] = new FeesAndLimits;
|
||||
$fee_and_limit['bank_transfer'] = new FeesAndLimits();
|
||||
|
||||
$fee_and_limit['bank_transfer']->adjust_fee_percent = 10;
|
||||
|
||||
@ -250,7 +250,7 @@ class CompanyGatewayApiTest extends TestCase
|
||||
'max_limit' => 2,
|
||||
];
|
||||
|
||||
$fal = (array) new FeesAndLimits;
|
||||
$fal = (array) new FeesAndLimits();
|
||||
|
||||
$new_arr = array_replace($fal, $arr);
|
||||
|
||||
@ -261,7 +261,7 @@ class CompanyGatewayApiTest extends TestCase
|
||||
public function testFeesAndLimitsFeeAmountCalcuation()
|
||||
{
|
||||
//{"1":{"min_limit":1,"max_limit":1000000,"fee_amount":10,"fee_percent":2,"fee_tax_name1":"","fee_tax_name2":"","fee_tax_name3":"","fee_tax_rate1":0,"fee_tax_rate2":0,"fee_tax_rate3":0,"fee_cap":10,"adjust_fee_percent":true}}
|
||||
$fee = new FeesAndLimits;
|
||||
$fee = new FeesAndLimits();
|
||||
$fee->fee_amount = 10;
|
||||
// $fee->fee_percent = 2;
|
||||
// $fee->fee_tax_name1 = 'GST';
|
||||
@ -294,7 +294,7 @@ class CompanyGatewayApiTest extends TestCase
|
||||
public function testFeesAndLimitsFeePercentCalcuation()
|
||||
{
|
||||
//{"1":{"min_limit":1,"max_limit":1000000,"fee_amount":10,"fee_percent":2,"fee_tax_name1":"","fee_tax_name2":"","fee_tax_name3":"","fee_tax_rate1":0,"fee_tax_rate2":0,"fee_tax_rate3":0,"fee_cap":10,"adjust_fee_percent":true}}
|
||||
$fee = new FeesAndLimits;
|
||||
$fee = new FeesAndLimits();
|
||||
//$fee->fee_amount = 10;
|
||||
$fee->fee_percent = 2;
|
||||
// $fee->fee_tax_name1 = 'GST';
|
||||
@ -327,7 +327,7 @@ class CompanyGatewayApiTest extends TestCase
|
||||
public function testFeesAndLimitsFeePercentAndAmountCalcuation()
|
||||
{
|
||||
//{"1":{"min_limit":1,"max_limit":1000000,"fee_amount":10,"fee_percent":2,"fee_tax_name1":"","fee_tax_name2":"","fee_tax_name3":"","fee_tax_rate1":0,"fee_tax_rate2":0,"fee_tax_rate3":0,"fee_cap":10,"adjust_fee_percent":true}}
|
||||
$fee = new FeesAndLimits;
|
||||
$fee = new FeesAndLimits();
|
||||
$fee->fee_amount = 10;
|
||||
$fee->fee_percent = 2;
|
||||
// $fee->fee_tax_name1 = 'GST';
|
||||
@ -360,7 +360,7 @@ class CompanyGatewayApiTest extends TestCase
|
||||
public function testFeesAndLimitsFeePercentAndAmountCalcuationOneHundredPercent()
|
||||
{
|
||||
//{"1":{"min_limit":1,"max_limit":1000000,"fee_amount":10,"fee_percent":2,"fee_tax_name1":"","fee_tax_name2":"","fee_tax_name3":"","fee_tax_rate1":0,"fee_tax_rate2":0,"fee_tax_rate3":0,"fee_cap":10,"adjust_fee_percent":true}}
|
||||
$fee = new FeesAndLimits;
|
||||
$fee = new FeesAndLimits();
|
||||
$fee->fee_amount = 0;
|
||||
$fee->fee_percent = 100;
|
||||
$fee->adjust_fee_percent = false;
|
||||
@ -393,7 +393,7 @@ class CompanyGatewayApiTest extends TestCase
|
||||
|
||||
public function testFeesAndLimitsFeePercentAndAmountCalcuationOneHundredPercentVariationOne()
|
||||
{
|
||||
$fee = new FeesAndLimits;
|
||||
$fee = new FeesAndLimits();
|
||||
$fee->fee_amount = 0;
|
||||
$fee->fee_percent = 10;
|
||||
|
||||
@ -424,7 +424,7 @@ class CompanyGatewayApiTest extends TestCase
|
||||
public function testFeesAndLimitsFeePercentAndAmountAndTaxCalcuation()
|
||||
{
|
||||
//{"1":{"min_limit":1,"max_limit":1000000,"fee_amount":10,"fee_percent":2,"fee_tax_name1":"","fee_tax_name2":"","fee_tax_name3":"","fee_tax_rate1":0,"fee_tax_rate2":0,"fee_tax_rate3":0,"fee_cap":10,"adjust_fee_percent":true}}
|
||||
$fee = new FeesAndLimits;
|
||||
$fee = new FeesAndLimits();
|
||||
$fee->fee_amount = 10;
|
||||
// $fee->fee_percent = 2;
|
||||
$fee->fee_tax_name1 = 'GST';
|
||||
@ -457,7 +457,7 @@ class CompanyGatewayApiTest extends TestCase
|
||||
public function testFeesAndLimitsFeePercentAndAmountAndTaxCalcuationInclusiveTaxes()
|
||||
{
|
||||
//{"1":{"min_limit":1,"max_limit":1000000,"fee_amount":10,"fee_percent":2,"fee_tax_name1":"","fee_tax_name2":"","fee_tax_name3":"","fee_tax_rate1":0,"fee_tax_rate2":0,"fee_tax_rate3":0,"fee_cap":10,"adjust_fee_percent":true}}
|
||||
$fee = new FeesAndLimits;
|
||||
$fee = new FeesAndLimits();
|
||||
$fee->fee_amount = 10;
|
||||
// $fee->fee_percent = 2;
|
||||
$fee->fee_tax_name1 = 'GST';
|
||||
@ -490,7 +490,7 @@ class CompanyGatewayApiTest extends TestCase
|
||||
public function testFeesAndLimitsFeePercentAndAmountAndDoubleTaxCalcuation()
|
||||
{
|
||||
//{"1":{"min_limit":1,"max_limit":1000000,"fee_amount":10,"fee_percent":2,"fee_tax_name1":"","fee_tax_name2":"","fee_tax_name3":"","fee_tax_rate1":0,"fee_tax_rate2":0,"fee_tax_rate3":0,"fee_cap":10,"adjust_fee_percent":true}}
|
||||
$fee = new FeesAndLimits;
|
||||
$fee = new FeesAndLimits();
|
||||
$fee->fee_amount = 10;
|
||||
// $fee->fee_percent = 2;
|
||||
$fee->fee_tax_name1 = 'GST';
|
||||
@ -525,7 +525,7 @@ class CompanyGatewayApiTest extends TestCase
|
||||
public function testFeesAndLimitsFeePercentAndAmountAndDoubleTaxCalcuationWithFeeCap()
|
||||
{
|
||||
//{"1":{"min_limit":1,"max_limit":1000000,"fee_amount":10,"fee_percent":2,"fee_tax_name1":"","fee_tax_name2":"","fee_tax_name3":"","fee_tax_rate1":0,"fee_tax_rate2":0,"fee_tax_rate3":0,"fee_cap":10,"adjust_fee_percent":true}}
|
||||
$fee = new FeesAndLimits;
|
||||
$fee = new FeesAndLimits();
|
||||
$fee->fee_amount = 10;
|
||||
// $fee->fee_percent = 2;
|
||||
$fee->fee_tax_name1 = 'GST';
|
||||
|
@ -35,7 +35,7 @@ class CompanyGatewayResolutionTest extends TestCase
|
||||
|
||||
public $cg1;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -55,7 +55,7 @@ class CompanyGatewayResolutionTest extends TestCase
|
||||
|
||||
$this->withoutExceptionHandling();
|
||||
|
||||
CompanyGateway::query()->withTrashed()->cursor()->each(function ($cg){
|
||||
CompanyGateway::query()->withTrashed()->cursor()->each(function ($cg) {
|
||||
$cg->forceDelete();
|
||||
});
|
||||
|
||||
@ -91,7 +91,7 @@ class CompanyGatewayResolutionTest extends TestCase
|
||||
//disable ach here
|
||||
$json_config = json_decode(config('ninja.testvars.stripe'));
|
||||
|
||||
$this->cg = new CompanyGateway;
|
||||
$this->cg = new CompanyGateway();
|
||||
$this->cg->company_id = $this->company->id;
|
||||
$this->cg->user_id = $this->user->id;
|
||||
$this->cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23';
|
||||
@ -185,7 +185,7 @@ class CompanyGatewayResolutionTest extends TestCase
|
||||
//disable ach here
|
||||
$json_config = json_decode(config('ninja.testvars.stripe'));
|
||||
|
||||
$this->cg = new CompanyGateway;
|
||||
$this->cg = new CompanyGateway();
|
||||
$this->cg->company_id = $this->company->id;
|
||||
$this->cg->user_id = $this->user->id;
|
||||
$this->cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23';
|
||||
@ -237,7 +237,7 @@ class CompanyGatewayResolutionTest extends TestCase
|
||||
//disable ach here
|
||||
$json_config = json_decode(config('ninja.testvars.stripe'));
|
||||
|
||||
$this->cg = new CompanyGateway;
|
||||
$this->cg = new CompanyGateway();
|
||||
$this->cg->company_id = $this->company->id;
|
||||
$this->cg->user_id = $this->user->id;
|
||||
$this->cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23';
|
||||
|
@ -30,7 +30,7 @@ class CompanyGatewayTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
// use RefreshDatabase;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -80,7 +80,7 @@ class CompanyGatewayTest extends TestCase
|
||||
$data[1]['fee_cap'] = 0;
|
||||
$data[1]['is_enabled'] = true;
|
||||
|
||||
$cg = new CompanyGateway;
|
||||
$cg = new CompanyGateway();
|
||||
$cg->company_id = $this->company->id;
|
||||
$cg->user_id = $this->user->id;
|
||||
$cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23';
|
||||
@ -152,7 +152,7 @@ class CompanyGatewayTest extends TestCase
|
||||
$data[1]['fee_cap'] = 0;
|
||||
$data[1]['is_enabled'] = true;
|
||||
|
||||
$cg = new CompanyGateway;
|
||||
$cg = new CompanyGateway();
|
||||
$cg->company_id = $this->company->id;
|
||||
$cg->user_id = $this->user->id;
|
||||
$cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23';
|
||||
@ -191,7 +191,7 @@ class CompanyGatewayTest extends TestCase
|
||||
$data[1]['fee_cap'] = 0;
|
||||
$data[1]['is_enabled'] = true;
|
||||
|
||||
$cg = new CompanyGateway;
|
||||
$cg = new CompanyGateway();
|
||||
$cg->company_id = $this->company->id;
|
||||
$cg->user_id = $this->user->id;
|
||||
$cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23';
|
||||
@ -237,7 +237,7 @@ class CompanyGatewayTest extends TestCase
|
||||
$data[1]['fee_cap'] = 0;
|
||||
$data[1]['is_enabled'] = true;
|
||||
|
||||
$cg = new CompanyGateway;
|
||||
$cg = new CompanyGateway();
|
||||
$cg->company_id = $this->company->id;
|
||||
$cg->user_id = $this->user->id;
|
||||
$cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23';
|
||||
@ -285,7 +285,7 @@ class CompanyGatewayTest extends TestCase
|
||||
$data[1]['fee_cap'] = 0;
|
||||
$data[1]['is_enabled'] = true;
|
||||
|
||||
$cg = new CompanyGateway;
|
||||
$cg = new CompanyGateway();
|
||||
$cg->company_id = $this->company->id;
|
||||
$cg->user_id = $this->user->id;
|
||||
$cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23';
|
||||
|
@ -8,6 +8,7 @@
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\DataMapper\CompanySettings;
|
||||
@ -31,7 +32,7 @@ class CompanySettingsTest extends TestCase
|
||||
use MockAccountData;
|
||||
// use RefreshDatabase;
|
||||
|
||||
public function setUp() :void
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -37,7 +37,7 @@ class CompanyTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -31,7 +31,7 @@ class CompanyTokenApiTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -31,7 +31,7 @@ class DeleteInvoiceTest extends TestCase
|
||||
use MockAccountData;
|
||||
use MakesHash;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -34,7 +34,7 @@ class DesignApiTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -32,7 +32,7 @@ class DocumentsApiTest extends TestCase
|
||||
|
||||
protected $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -47,7 +47,7 @@ class DocumentsApiTest extends TestCase
|
||||
|
||||
public function testDocumentFilters()
|
||||
{
|
||||
Document::query()->withTrashed()->cursor()->each(function ($d){
|
||||
Document::query()->withTrashed()->cursor()->each(function ($d) {
|
||||
$d->forceDelete();
|
||||
});
|
||||
|
||||
@ -73,7 +73,7 @@ class DocumentsApiTest extends TestCase
|
||||
|
||||
public function testDocumentFilters2()
|
||||
{
|
||||
Document::query()->withTrashed()->cursor()->each(function ($d){
|
||||
Document::query()->withTrashed()->cursor()->each(function ($d) {
|
||||
$d->forceDelete();
|
||||
});
|
||||
|
||||
@ -98,7 +98,7 @@ class DocumentsApiTest extends TestCase
|
||||
|
||||
public function testDocumentFilters3()
|
||||
{
|
||||
Document::query()->withTrashed()->cursor()->each(function ($d){
|
||||
Document::query()->withTrashed()->cursor()->each(function ($d) {
|
||||
$d->forceDelete();
|
||||
});
|
||||
|
||||
|
@ -24,7 +24,7 @@ class FacturaeTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -88,7 +88,7 @@ class FatturaPATest extends TestCase
|
||||
'settings' => $client_settings,
|
||||
]);
|
||||
|
||||
$item = new InvoiceItem;
|
||||
$item = new InvoiceItem();
|
||||
$item->product_key = "Product Key";
|
||||
$item->notes = "Product Description";
|
||||
$item->cost = 10;
|
||||
@ -110,7 +110,7 @@ class FatturaPATest extends TestCase
|
||||
'tax_name2' => '',
|
||||
'tax_name3' => '',
|
||||
'line_items' => [$item],
|
||||
'number' => 'ITA-'.rand(1000,100000)
|
||||
'number' => 'ITA-'.rand(1000, 100000)
|
||||
]);
|
||||
|
||||
$invoice->service()->markSent()->save();
|
||||
@ -126,11 +126,12 @@ class FatturaPATest extends TestCase
|
||||
$this->assertInstanceOf(FatturaElettronicaBody::class, $fe->FatturaElettronicaBody[0]);
|
||||
$this->assertInstanceOf(FatturaElettronicaHeader::class, $fe->FatturaElettronicaHeader);
|
||||
|
||||
$e = new EInvoice;
|
||||
$e = new EInvoice();
|
||||
$errors = $e->validate($fe);
|
||||
|
||||
if(count($errors) > 0)
|
||||
if(count($errors) > 0) {
|
||||
nlog($errors);
|
||||
}
|
||||
|
||||
$this->assertCount(0, $errors);
|
||||
|
||||
|
@ -86,7 +86,7 @@ class PeppolTest extends TestCase
|
||||
$pm->PayeeFinancialAccount = $pfa;
|
||||
$einvoice->PaymentMeans[] = $pm;
|
||||
|
||||
$stub = new \stdClass;
|
||||
$stub = new \stdClass();
|
||||
$stub->Invoice = $einvoice;
|
||||
|
||||
$company = Company::factory()->create([
|
||||
|
@ -31,7 +31,7 @@ class EntityPaidToDateTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -34,7 +34,7 @@ class ExpenseApiTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -28,7 +28,7 @@ class ExpenseCategoryApiTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -34,7 +34,7 @@ class ArDetailReportTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -32,7 +32,7 @@ class ArSummaryReportTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -32,7 +32,7 @@ class ClientBalanceReportTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -24,7 +24,7 @@ class ClientCsvTest extends TestCase
|
||||
use MakesHash;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -32,7 +32,7 @@ class ClientSalesReportTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -27,7 +27,7 @@ class ExportCsvTest extends TestCase
|
||||
use MakesHash;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -36,7 +36,7 @@ class ProductSalesReportTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -37,7 +37,7 @@ class ProfitAndLossReportTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -26,7 +26,7 @@ class ReportApiTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -42,7 +42,7 @@ class ReportCsvGenerationTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -225,7 +225,7 @@ class ReportCsvGenerationTest extends TestCase
|
||||
|
||||
$this->token = \Illuminate\Support\Str::random(64);
|
||||
|
||||
$company_token = new CompanyToken;
|
||||
$company_token = new CompanyToken();
|
||||
$company_token->user_id = $this->user->id;
|
||||
$company_token->company_id = $this->company->id;
|
||||
$company_token->account_id = $this->account->id;
|
||||
@ -270,7 +270,7 @@ class ReportCsvGenerationTest extends TestCase
|
||||
{
|
||||
Invoice::factory()->count(5)->create(
|
||||
[
|
||||
'client_id'=> $this->client->id,
|
||||
'client_id' => $this->client->id,
|
||||
'company_id' => $this->company->id,
|
||||
'user_id' => $this->user->id
|
||||
]
|
||||
@ -694,7 +694,7 @@ class ReportCsvGenerationTest extends TestCase
|
||||
|
||||
$csv = $response->body();
|
||||
|
||||
// nlog($csv);
|
||||
// nlog($csv);
|
||||
$this->assertEquals(3600, $this->getFirstValueByColumn($csv, 'Task Duration'));
|
||||
$this->assertEquals('test1', $this->getFirstValueByColumn($csv, 'Task Description'));
|
||||
$this->assertEquals('16/Jul/2023', $this->getFirstValueByColumn($csv, 'Task Start Date'));
|
||||
|
@ -32,7 +32,7 @@ class TaxSummaryReportTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -34,7 +34,7 @@ class UserSalesReportTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -25,7 +25,7 @@ class FilterApiTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -97,7 +97,7 @@ class GoCardlessInstantBankPaymentTest extends TestCase
|
||||
];
|
||||
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -125,8 +125,8 @@ class GoCardlessInstantBankPaymentTest extends TestCase
|
||||
|
||||
public function testInvoiceDelayedNotificationPayment()
|
||||
{
|
||||
$gocardlesspayment = new \stdClass;
|
||||
$links = new \stdClass;
|
||||
$gocardlesspayment = new \stdClass();
|
||||
$links = new \stdClass();
|
||||
$links->mandate = "my_mandate";
|
||||
$gocardlesspayment->links = $links;
|
||||
$gocardlesspayment->id = "gocardless_payment_id";
|
||||
@ -172,7 +172,7 @@ class GoCardlessInstantBankPaymentTest extends TestCase
|
||||
$this->assertEquals($invoice->balance, $test_invoice_object->amount);
|
||||
|
||||
|
||||
$cg = new CompanyGateway;
|
||||
$cg = new CompanyGateway();
|
||||
$cg->company_id = $this->company->id;
|
||||
$cg->user_id = $this->user->id;
|
||||
$cg->gateway_key = 'b9886f9257f0c6ee7c302f1c74475f6c';
|
||||
|
@ -41,7 +41,7 @@ class GroupSettingTest extends TestCase
|
||||
public function testCastingMagic()
|
||||
{
|
||||
|
||||
$settings = new \stdClass;
|
||||
$settings = new \stdClass();
|
||||
$settings->currency_id = '1';
|
||||
$settings->tax_name1 = '';
|
||||
$settings->tax_rate1 = 0;
|
||||
@ -51,7 +51,7 @@ class GroupSettingTest extends TestCase
|
||||
$this->assertEquals("", $settings->tax_name1);
|
||||
$settings = null;
|
||||
|
||||
$settings = new \stdClass;
|
||||
$settings = new \stdClass();
|
||||
$settings->currency_id = '1';
|
||||
$settings->tax_name1 = "1";
|
||||
$settings->tax_rate1 = 0;
|
||||
@ -63,7 +63,7 @@ class GroupSettingTest extends TestCase
|
||||
$settings = $s->cast($settings)->toArray();
|
||||
$this->assertEquals("1", $settings['tax_name1']);
|
||||
|
||||
$settings = new \stdClass;
|
||||
$settings = new \stdClass();
|
||||
$settings->currency_id = '1';
|
||||
$settings->tax_name1 = [];
|
||||
$settings->tax_rate1 = 0;
|
||||
@ -75,9 +75,9 @@ class GroupSettingTest extends TestCase
|
||||
$settings = $s->cast($settings)->toArray();
|
||||
$this->assertEquals("", $settings['tax_name1']);
|
||||
|
||||
$settings = new \stdClass;
|
||||
$settings = new \stdClass();
|
||||
$settings->currency_id = '1';
|
||||
$settings->tax_name1 = new \stdClass;
|
||||
$settings->tax_name1 = new \stdClass();
|
||||
$settings->tax_rate1 = 0;
|
||||
|
||||
$settings = $s->cast($settings)->toObject();
|
||||
@ -94,7 +94,7 @@ class GroupSettingTest extends TestCase
|
||||
|
||||
public function testTaxNameInGroupFilters()
|
||||
{
|
||||
$settings = new \stdClass;
|
||||
$settings = new \stdClass();
|
||||
$settings->currency_id = '1';
|
||||
$settings->tax_name1 = '';
|
||||
$settings->tax_rate1 = 0;
|
||||
@ -120,7 +120,7 @@ class GroupSettingTest extends TestCase
|
||||
|
||||
public function testAddGroupFilters()
|
||||
{
|
||||
$settings = new \stdClass;
|
||||
$settings = new \stdClass();
|
||||
$settings->currency_id = '1';
|
||||
|
||||
$data = [
|
||||
@ -156,7 +156,7 @@ class GroupSettingTest extends TestCase
|
||||
|
||||
public function testAddGroupSettings()
|
||||
{
|
||||
$settings = new \stdClass;
|
||||
$settings = new \stdClass();
|
||||
$settings->currency_id = '1';
|
||||
|
||||
$data = [
|
||||
@ -179,7 +179,7 @@ class GroupSettingTest extends TestCase
|
||||
|
||||
public function testArchiveGroupSettings()
|
||||
{
|
||||
$settings = new \stdClass;
|
||||
$settings = new \stdClass();
|
||||
$settings->currency_id = '1';
|
||||
|
||||
$data = [
|
||||
|
@ -28,7 +28,8 @@ class ImportQuickbooksControllerTest extends TestCase
|
||||
private $mock;
|
||||
private $state;
|
||||
|
||||
protected function setUp(): void {
|
||||
protected function setUp(): void
|
||||
{
|
||||
|
||||
parent::setUp();
|
||||
|
||||
@ -53,7 +54,7 @@ class ImportQuickbooksControllerTest extends TestCase
|
||||
Cache::spy();
|
||||
Cache::shouldReceive('get')
|
||||
->with($token = $this->company->company_key)
|
||||
->andReturn( ['company_key' => $token, 'id' => $this->company->id]);
|
||||
->andReturn(['company_key' => $token, 'id' => $this->company->id]);
|
||||
Cache::shouldReceive('has')
|
||||
->andReturn(true);
|
||||
// Perform the test
|
||||
@ -67,7 +68,7 @@ class ImportQuickbooksControllerTest extends TestCase
|
||||
{
|
||||
$token = ['company_key' => $this->company->company_key, 'id' => $this->company->id] ;
|
||||
|
||||
$this->mock->shouldReceive('getAccessToken')->andReturn(Mockery::mock(stdClass::class,function(MockInterface $mock){
|
||||
$this->mock->shouldReceive('getAccessToken')->andReturn(Mockery::mock(stdClass::class, function (MockInterface $mock) {
|
||||
$mock->shouldReceive('getAccessToken')->andReturn('abcdefg');
|
||||
$mock->shouldReceive('getRefreshToken')->andReturn('abcdefghi');
|
||||
$mock->shouldReceive('getAccessTokenExpiresAt')->andReturn(3600);
|
||||
@ -87,7 +88,7 @@ class ImportQuickbooksControllerTest extends TestCase
|
||||
|
||||
Cache::shouldHaveReceived('put')->once()->with($token['company_key'], 'abcdefg', 3600);
|
||||
|
||||
$this->mock->shouldHaveReceived('exchangeAuthorizationCodeForToken')->once()->with(123456,12345678);
|
||||
$this->mock->shouldHaveReceived('exchangeAuthorizationCodeForToken')->once()->with(123456, 12345678);
|
||||
}
|
||||
|
||||
public function testImport(): void
|
||||
@ -97,19 +98,19 @@ class ImportQuickbooksControllerTest extends TestCase
|
||||
$data = $this->setUpTestData('customers');
|
||||
$count = count($data);
|
||||
$this->mock->shouldReceive('Query')->andReturnUsing(
|
||||
function($val, $s = 1, $max = 1000) use ($count, $data) {
|
||||
function ($val, $s = 1, $max = 1000) use ($count, $data) {
|
||||
if(stristr($val, 'count')) {
|
||||
return $count;
|
||||
}
|
||||
|
||||
return Arr::take($data,$max);
|
||||
return Arr::take($data, $max);
|
||||
}
|
||||
);
|
||||
|
||||
// Perform the test
|
||||
$response = $this->actingAs($this->user)->withHeaders([
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->post('/api/v1/import/quickbooks',[
|
||||
])->post('/api/v1/import/quickbooks', [
|
||||
'import_types' => ['client']
|
||||
]);
|
||||
$response->assertStatus(200);
|
||||
@ -118,9 +119,11 @@ class ImportQuickbooksControllerTest extends TestCase
|
||||
//Bus::assertDispatched(\App\Jobs\Import\QuickbooksIngest::class);
|
||||
}
|
||||
|
||||
protected function setUpTestData($file) {
|
||||
protected function setUpTestData($file)
|
||||
{
|
||||
$data = json_decode(
|
||||
file_get_contents(base_path("tests/Mock/Quickbooks/Data/$file.json")),true
|
||||
file_get_contents(base_path("tests/Mock/Quickbooks/Data/$file.json")),
|
||||
true
|
||||
);
|
||||
|
||||
return $data;
|
||||
|
@ -32,7 +32,7 @@ class BaseTransformerTest extends TestCase
|
||||
use MakesHash;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -68,7 +68,7 @@ class ImportCompanyTest extends TestCase
|
||||
|
||||
public $ids;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -93,7 +93,7 @@ class ImportCompanyTest extends TestCase
|
||||
|
||||
$backup_json_file_zip = base_path().'/tests/Feature/Import/backup.zip';
|
||||
|
||||
$zip = new \ZipArchive;
|
||||
$zip = new \ZipArchive();
|
||||
$res = $zip->open($backup_json_file_zip);
|
||||
if ($res === true) {
|
||||
$zip->extractTo(sys_get_temp_dir());
|
||||
@ -117,7 +117,7 @@ class ImportCompanyTest extends TestCase
|
||||
{
|
||||
$backup_json_file_zip = base_path().'/tests/Feature/Import/backup.zip';
|
||||
|
||||
$zip = new \ZipArchive;
|
||||
$zip = new \ZipArchive();
|
||||
$res = $zip->open($backup_json_file_zip);
|
||||
|
||||
if ($res === true) {
|
||||
@ -423,7 +423,7 @@ class ImportCompanyTest extends TestCase
|
||||
$this->genericImport(
|
||||
Vendor::class,
|
||||
['user_id', 'assigned_user_id', 'company_id', 'id', 'hashed_id'],
|
||||
[['users' => 'user_id'], ['users' =>'assigned_user_id']],
|
||||
[['users' => 'user_id'], ['users' => 'assigned_user_id']],
|
||||
'vendors',
|
||||
'number'
|
||||
);
|
||||
@ -437,7 +437,7 @@ class ImportCompanyTest extends TestCase
|
||||
$this->genericImport(
|
||||
Project::class,
|
||||
['user_id', 'assigned_user_id', 'company_id', 'id', 'hashed_id', 'client_id'],
|
||||
[['users' => 'user_id'], ['users' =>'assigned_user_id'], ['clients' => 'client_id']],
|
||||
[['users' => 'user_id'], ['users' => 'assigned_user_id'], ['clients' => 'client_id']],
|
||||
'projects',
|
||||
'number'
|
||||
);
|
||||
@ -453,7 +453,7 @@ class ImportCompanyTest extends TestCase
|
||||
$this->genericNewClassImport(
|
||||
Product::class,
|
||||
['user_id', 'company_id', 'hashed_id', 'id'],
|
||||
[['users' => 'user_id'], ['users' =>'assigned_user_id'], ['vendors' => 'vendor_id'], ['projects' => 'project_id']],
|
||||
[['users' => 'user_id'], ['users' => 'assigned_user_id'], ['vendors' => 'vendor_id'], ['projects' => 'project_id']],
|
||||
'products'
|
||||
);
|
||||
$this->assertEquals(1, Product::count());
|
||||
@ -1149,7 +1149,7 @@ class ImportCompanyTest extends TestCase
|
||||
return $this->ids[$resource]["{$old}"];
|
||||
}
|
||||
|
||||
protected function tearDown() :void
|
||||
protected function tearDown(): void
|
||||
{
|
||||
$backup_json_file = sys_get_temp_dir().'/backup/backup.json';
|
||||
|
||||
|
@ -18,7 +18,6 @@ use Illuminate\Support\Str;
|
||||
use ReflectionClass;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
|
||||
class QuickbooksTest extends TestCase
|
||||
{
|
||||
use MakesHash;
|
||||
@ -44,11 +43,11 @@ class QuickbooksTest extends TestCase
|
||||
|
||||
public function testImportCallsGetDataOnceForClient()
|
||||
{
|
||||
$data = (json_decode( file_get_contents( base_path('tests/Feature/Import/customers.json') ), true))['Customer'];
|
||||
$data = (json_decode(file_get_contents(base_path('tests/Feature/Import/customers.json')), true))['Customer'];
|
||||
$hash = Str::random(32);
|
||||
Cache::put($hash.'-client', base64_encode(json_encode($data)), 360);
|
||||
|
||||
$quickbooks = Mockery::mock(Quickbooks::class,[[
|
||||
$quickbooks = Mockery::mock(Quickbooks::class, [[
|
||||
'hash' => $hash,
|
||||
'column_map' => ['client' => ['mapping' => []]],
|
||||
'skip_header' => true,
|
||||
@ -68,19 +67,19 @@ class QuickbooksTest extends TestCase
|
||||
|
||||
$base_transformer = new BaseTransformer($this->company);
|
||||
$this->assertTrue($base_transformer->hasClient('Sonnenschein Family Store'));
|
||||
$contact = $base_transformer->getClient('Amy\'s Bird Sanctuary','');
|
||||
$contact = Client::where('name','Amy\'s Bird Sanctuary')->first();
|
||||
$this->assertEquals('(650) 555-3311',$contact->phone);
|
||||
$this->assertEquals('Birds@Intuit.com',$contact->contacts()->first()->email);
|
||||
$contact = $base_transformer->getClient('Amy\'s Bird Sanctuary', '');
|
||||
$contact = Client::where('name', 'Amy\'s Bird Sanctuary')->first();
|
||||
$this->assertEquals('(650) 555-3311', $contact->phone);
|
||||
$this->assertEquals('Birds@Intuit.com', $contact->contacts()->first()->email);
|
||||
}
|
||||
|
||||
public function testImportCallsGetDataOnceForProducts()
|
||||
{
|
||||
$data = (json_decode( file_get_contents( base_path('tests/Feature/Import/items.json') ), true))['Item'];
|
||||
$data = (json_decode(file_get_contents(base_path('tests/Feature/Import/items.json')), true))['Item'];
|
||||
$hash = Str::random(32);
|
||||
Cache::put($hash.'-item', base64_encode(json_encode($data)), 360);
|
||||
|
||||
$quickbooks = Mockery::mock(Quickbooks::class,[[
|
||||
$quickbooks = Mockery::mock(Quickbooks::class, [[
|
||||
'hash' => $hash,
|
||||
'column_map' => ['item' => ['mapping' => []]],
|
||||
'skip_header' => true,
|
||||
@ -100,17 +99,17 @@ class QuickbooksTest extends TestCase
|
||||
|
||||
$base_transformer = new BaseTransformer($this->company);
|
||||
$this->assertTrue($base_transformer->hasProduct('Gardening'));
|
||||
$product = Product::where('product_key','Pest Control')->first();
|
||||
$this->assertGreaterThanOrEqual( 35, $product->price);
|
||||
$product = Product::where('product_key', 'Pest Control')->first();
|
||||
$this->assertGreaterThanOrEqual(35, $product->price);
|
||||
$this->assertLessThanOrEqual(0, $product->quantity);
|
||||
}
|
||||
|
||||
public function testImportCallsGetDataOnceForInvoices()
|
||||
{
|
||||
$data = (json_decode( file_get_contents( base_path('tests/Feature/Import/invoices.json') ), true))['Invoice'];
|
||||
$data = (json_decode(file_get_contents(base_path('tests/Feature/Import/invoices.json')), true))['Invoice'];
|
||||
$hash = Str::random(32);
|
||||
Cache::put($hash.'-invoice', base64_encode(json_encode($data)), 360);
|
||||
$quickbooks = Mockery::mock(Quickbooks::class,[[
|
||||
$quickbooks = Mockery::mock(Quickbooks::class, [[
|
||||
'hash' => $hash,
|
||||
'column_map' => ['invoice' => ['mapping' => []]],
|
||||
'skip_header' => true,
|
||||
@ -125,10 +124,10 @@ class QuickbooksTest extends TestCase
|
||||
$this->assertGreaterThan(0, $quickbooks->entity_count['invoices']);
|
||||
$base_transformer = new BaseTransformer($this->company);
|
||||
$this->assertTrue($base_transformer->hasInvoice(1007));
|
||||
$invoice = Invoice::where('number',1012)->first();
|
||||
$data = collect($data)->where('DocNumber','1012')->first();
|
||||
$this->assertGreaterThanOrEqual( $data['TotalAmt'], $invoice->amount);
|
||||
$this->assertEquals( count($data['Line']) - 1 , count((array)$invoice->line_items));
|
||||
$invoice = Invoice::where('number', 1012)->first();
|
||||
$data = collect($data)->where('DocNumber', '1012')->first();
|
||||
$this->assertGreaterThanOrEqual($data['TotalAmt'], $invoice->amount);
|
||||
$this->assertEquals(count($data['Line']) - 1, count((array)$invoice->line_items));
|
||||
}
|
||||
|
||||
|
||||
|
@ -28,7 +28,7 @@ class InventoryManagementTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -62,7 +62,7 @@ class InventoryManagementTest extends TestCase
|
||||
$invoice->company->track_inventory = true;
|
||||
$invoice->push();
|
||||
|
||||
$invoice_item = new InvoiceItem;
|
||||
$invoice_item = new InvoiceItem();
|
||||
$invoice_item->type_id = 1;
|
||||
$invoice_item->product_key = $product->product_key;
|
||||
$invoice_item->notes = $product->notes;
|
||||
|
@ -35,7 +35,7 @@ class InvitationTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
// use RefreshDatabase;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -27,7 +27,7 @@ class InvoiceAmountPaymentTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -34,7 +34,7 @@ class InvoiceEmailTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -166,9 +166,9 @@ class InvoiceEmailTest extends TestCase
|
||||
$data = [
|
||||
"body" => "hey what's up",
|
||||
"entity" => 'invoice',
|
||||
"entity_id"=> $this->invoice->hashed_id,
|
||||
"subject"=> 'Reminder $number',
|
||||
"template"=> "first_custom"
|
||||
"entity_id" => $this->invoice->hashed_id,
|
||||
"subject" => 'Reminder $number',
|
||||
"template" => "first_custom"
|
||||
];
|
||||
|
||||
$response = false;
|
||||
|
@ -27,7 +27,7 @@ class InvoiceLinkTasksTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -39,7 +39,7 @@ class InvoiceTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -84,7 +84,7 @@ class InvoiceTest extends TestCase
|
||||
$response = $this->withHeaders([
|
||||
'X-API-SECRET' => config('ninja.api_secret'),
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->postJson('/api/v1/invoices?mark_sent=true',$data)
|
||||
])->postJson('/api/v1/invoices?mark_sent=true', $data)
|
||||
->assertStatus(200);
|
||||
|
||||
$arr = $response->json();
|
||||
|
@ -39,7 +39,7 @@ class QuickbooksIngestTest extends TestCase
|
||||
*/
|
||||
public function testCanQuickbooksIngest(): void
|
||||
{
|
||||
$data = (json_decode( file_get_contents( base_path('tests/Feature/Import/customers.json') ), true))['Customer'];
|
||||
$data = (json_decode(file_get_contents(base_path('tests/Feature/Import/customers.json')), true))['Customer'];
|
||||
$hash = Str::random(32);
|
||||
Cache::put($hash.'-client', base64_encode(json_encode($data)), 360);
|
||||
QuickbooksIngest::dispatch([
|
||||
@ -47,7 +47,7 @@ class QuickbooksIngestTest extends TestCase
|
||||
'column_map' => ['client' => ['mapping' => []]],
|
||||
'skip_header' => true,
|
||||
'import_types' => ['client'],
|
||||
], $this->company )->handle();
|
||||
], $this->company)->handle();
|
||||
$this->assertTrue(Client::withTrashed()->where(['company_id' => $this->company->id, 'name' => "Freeman Sporting Goods"])->exists());
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ class LiveDesignTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -46,7 +46,7 @@ class LoadTest extends TestCase
|
||||
|
||||
public int $count = 1;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -74,7 +74,7 @@ class LoadTest extends TestCase
|
||||
]);
|
||||
}
|
||||
|
||||
$company_token = new CompanyToken;
|
||||
$company_token = new CompanyToken();
|
||||
$company_token->user_id = $user->id;
|
||||
$company_token->company_id = $company->id;
|
||||
$company_token->account_id = $account->id;
|
||||
|
@ -29,7 +29,7 @@ class LoginTest extends TestCase
|
||||
{
|
||||
use DatabaseTransactions;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
Session::start();
|
||||
@ -155,7 +155,7 @@ class LoginTest extends TestCase
|
||||
$account->default_company_id = $company->id;
|
||||
$account->save();
|
||||
|
||||
$company_token = new CompanyToken;
|
||||
$company_token = new CompanyToken();
|
||||
$company_token->user_id = $user->id;
|
||||
$company_token->company_id = $company->id;
|
||||
$company_token->account_id = $account->id;
|
||||
|
@ -32,7 +32,7 @@ class MaxAmountTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -136,7 +136,7 @@ class MaxAmountTest extends TestCase
|
||||
$response->assertStatus(422);
|
||||
}
|
||||
|
||||
public function testPurchaseOrderMaxAmount()
|
||||
public function testPurchaseOrderMaxAmount()
|
||||
{
|
||||
$item = new InvoiceItem();
|
||||
$item->cost = 10000000000000000;
|
||||
|
@ -29,7 +29,7 @@ class MigrationTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -31,11 +31,12 @@ use Tests\TestCase;
|
||||
*/
|
||||
class MultiPaymentDeleteTest extends TestCase
|
||||
{
|
||||
use DatabaseTransactions, MakesHash;
|
||||
use DatabaseTransactions;
|
||||
use MakesHash;
|
||||
|
||||
private $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -63,7 +64,7 @@ class MultiPaymentDeleteTest extends TestCase
|
||||
$cu->is_admin = true;
|
||||
$cu->save();
|
||||
|
||||
$token = new CompanyToken;
|
||||
$token = new CompanyToken();
|
||||
$token->user_id = $user->id;
|
||||
$token->company_id = $company->id;
|
||||
$token->account_id = $account->id;
|
||||
|
@ -32,7 +32,7 @@ class PlanTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -93,7 +93,7 @@ class PlanTest extends TestCase
|
||||
{
|
||||
$this->markTestSkipped();
|
||||
|
||||
$license = new License;
|
||||
$license = new License();
|
||||
$license->license_key = "1234";
|
||||
$license->product_id = "3";
|
||||
$license->email = 'test@gmail.com';
|
||||
|
@ -35,7 +35,7 @@ class NotificationTest extends TestCase
|
||||
|
||||
protected $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -56,7 +56,7 @@ class NotificationTest extends TestCase
|
||||
'confirmation_code' => uniqid("st", true),
|
||||
]);
|
||||
|
||||
$company_token = new CompanyToken;
|
||||
$company_token = new CompanyToken();
|
||||
$company_token->user_id = $u->id;
|
||||
$company_token->company_id = $this->company->id;
|
||||
$company_token->account_id = $this->account->id;
|
||||
@ -76,7 +76,7 @@ class NotificationTest extends TestCase
|
||||
|
||||
$company_user = CompanyUser::where('user_id', $u->id)->where('company_id', $this->company->id)->first();
|
||||
|
||||
$notifications = new \stdClass;
|
||||
$notifications = new \stdClass();
|
||||
$notifications->email = ["invoice_late_user","quote_approved_user"];
|
||||
$company_user->update(['notifications' => (array)$notifications]);
|
||||
|
||||
@ -106,7 +106,7 @@ class NotificationTest extends TestCase
|
||||
|
||||
public function testNotificationFound()
|
||||
{
|
||||
$notifications = new \stdClass;
|
||||
$notifications = new \stdClass();
|
||||
$notifications->email = ["inventory_all"];
|
||||
|
||||
$this->user->company_users()->where('company_id', $this->company->id)->update(['notifications' => (array)$notifications]);
|
||||
@ -130,7 +130,7 @@ class NotificationTest extends TestCase
|
||||
|
||||
public function testAllNotificationsFires()
|
||||
{
|
||||
$notifications = new \stdClass;
|
||||
$notifications = new \stdClass();
|
||||
$notifications->email = ["all_notifications"];
|
||||
|
||||
$p = Product::factory()->create([
|
||||
@ -146,7 +146,7 @@ class NotificationTest extends TestCase
|
||||
|
||||
public function testAllNotificationsFiresForUser()
|
||||
{
|
||||
$notifications = new \stdClass;
|
||||
$notifications = new \stdClass();
|
||||
$notifications->email = ["all_user_notifications"];
|
||||
|
||||
$p = Product::factory()->create([
|
||||
@ -168,7 +168,7 @@ class NotificationTest extends TestCase
|
||||
'confirmation_code' => uniqid("st", true),
|
||||
]);
|
||||
|
||||
$company_token = new CompanyToken;
|
||||
$company_token = new CompanyToken();
|
||||
$company_token->user_id = $u->id;
|
||||
$company_token->company_id = $this->company->id;
|
||||
$company_token->account_id = $this->account->id;
|
||||
@ -192,7 +192,7 @@ class NotificationTest extends TestCase
|
||||
]);
|
||||
|
||||
|
||||
$notifications = new \stdClass;
|
||||
$notifications = new \stdClass();
|
||||
$notifications->email = ["all_user_notifications"];
|
||||
$this->user->company_users()->where('company_id', $this->company->id)->update(['notifications' => (array)$notifications]);
|
||||
|
||||
|
@ -36,7 +36,7 @@ class WebhookTest extends TestCase
|
||||
|
||||
private float $amount = 1285.13;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -82,7 +82,7 @@ class WebhookTest extends TestCase
|
||||
'is_recurring' => false,
|
||||
];
|
||||
|
||||
$payment_hash = new PaymentHash;
|
||||
$payment_hash = new PaymentHash();
|
||||
$payment_hash->hash = Str::random(32);
|
||||
$payment_hash->data = $hash_data;
|
||||
$payment_hash->fee_total = 0;
|
||||
@ -113,7 +113,7 @@ class WebhookTest extends TestCase
|
||||
|
||||
private function buildGateway()
|
||||
{
|
||||
$config = new \stdClass;
|
||||
$config = new \stdClass();
|
||||
$config->merchantId = $this->merchant_id;
|
||||
$config->status = 'activated';
|
||||
$config->consent = 'true';
|
||||
@ -122,7 +122,7 @@ class WebhookTest extends TestCase
|
||||
$config->returnMessage = 'true';
|
||||
$config->paymentsReceivable = 'Yes';
|
||||
|
||||
$cg = new CompanyGateway;
|
||||
$cg = new CompanyGateway();
|
||||
$cg->company_id = $this->company->id;
|
||||
$cg->user_id = $this->user->id;
|
||||
$cg->gateway_key = '80af24a6a691230bbec33e930ab40666';
|
||||
@ -133,8 +133,8 @@ class WebhookTest extends TestCase
|
||||
$cg->config = encrypt($config);
|
||||
$cg->save();
|
||||
|
||||
$fees_and_limits = new stdClass;
|
||||
$fees_and_limits->{3} = new FeesAndLimits;
|
||||
$fees_and_limits = new stdClass();
|
||||
$fees_and_limits->{3} = new FeesAndLimits();
|
||||
|
||||
$cg->fees_and_limits = $fees_and_limits;
|
||||
$cg->save();
|
||||
|
@ -110,7 +110,7 @@ class PaymentLinkTest extends TestCase
|
||||
|
||||
$price = $target->link_service()->calculateUpgradePriceV2($recurring_invoice, $target);
|
||||
|
||||
$refund = round($invoice->paid_to_date*$ratio,2);
|
||||
$refund = round($invoice->paid_to_date * $ratio, 2);
|
||||
|
||||
$this->assertEquals(($target->price - $refund), $price);
|
||||
|
||||
|
@ -31,7 +31,7 @@ class PaymentTermsApiTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -44,7 +44,7 @@ class PaymentTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -550,7 +550,7 @@ class PaymentTest extends TestCase
|
||||
|
||||
public function testStorePaymentWithClientId()
|
||||
{
|
||||
$client = Client::factory()->create(['company_id' =>$this->company->id, 'user_id' => $this->user->id]);
|
||||
$client = Client::factory()->create(['company_id' => $this->company->id, 'user_id' => $this->user->id]);
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $client->id,
|
||||
@ -616,7 +616,7 @@ class PaymentTest extends TestCase
|
||||
|
||||
public function testStorePaymentWithNoInvoiecs()
|
||||
{
|
||||
$client = Client::factory()->create(['company_id' =>$this->company->id, 'user_id' => $this->user->id]);
|
||||
$client = Client::factory()->create(['company_id' => $this->company->id, 'user_id' => $this->user->id]);
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $client->id,
|
||||
@ -663,7 +663,7 @@ class PaymentTest extends TestCase
|
||||
{
|
||||
$invoice = null;
|
||||
|
||||
$client = Client::factory()->create(['company_id' =>$this->company->id, 'user_id' => $this->user->id]);
|
||||
$client = Client::factory()->create(['company_id' => $this->company->id, 'user_id' => $this->user->id]);
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $client->id,
|
||||
@ -945,7 +945,7 @@ class PaymentTest extends TestCase
|
||||
{
|
||||
$invoice = null;
|
||||
|
||||
$client = Client::factory()->create(['company_id' =>$this->company->id, 'user_id' => $this->user->id]);
|
||||
$client = Client::factory()->create(['company_id' => $this->company->id, 'user_id' => $this->user->id]);
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $client->id,
|
||||
@ -1011,7 +1011,7 @@ class PaymentTest extends TestCase
|
||||
{
|
||||
$invoice = null;
|
||||
|
||||
$client = Client::factory()->create(['company_id' =>$this->company->id, 'user_id' => $this->user->id]);
|
||||
$client = Client::factory()->create(['company_id' => $this->company->id, 'user_id' => $this->user->id]);
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $client->id,
|
||||
@ -1070,7 +1070,7 @@ class PaymentTest extends TestCase
|
||||
{
|
||||
$invoice = null;
|
||||
|
||||
$client = Client::factory()->create(['company_id' =>$this->company->id, 'user_id' => $this->user->id]);
|
||||
$client = Client::factory()->create(['company_id' => $this->company->id, 'user_id' => $this->user->id]);
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $client->id,
|
||||
@ -1135,7 +1135,7 @@ class PaymentTest extends TestCase
|
||||
{
|
||||
$invoice = null;
|
||||
|
||||
$client = Client::factory()->create(['company_id' =>$this->company->id, 'user_id' => $this->user->id]);
|
||||
$client = Client::factory()->create(['company_id' => $this->company->id, 'user_id' => $this->user->id]);
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $client->id,
|
||||
@ -1240,7 +1240,7 @@ class PaymentTest extends TestCase
|
||||
{
|
||||
$invoice = null;
|
||||
|
||||
$client = Client::factory()->create(['company_id' =>$this->company->id, 'user_id' => $this->user->id]);
|
||||
$client = Client::factory()->create(['company_id' => $this->company->id, 'user_id' => $this->user->id]);
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $client->id,
|
||||
@ -1295,7 +1295,7 @@ class PaymentTest extends TestCase
|
||||
|
||||
public function testStorePaymentWithNoAmountField()
|
||||
{
|
||||
$client = Client::factory()->create(['company_id' =>$this->company->id, 'user_id' => $this->user->id]);
|
||||
$client = Client::factory()->create(['company_id' => $this->company->id, 'user_id' => $this->user->id]);
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $client->id,
|
||||
@ -1361,7 +1361,7 @@ class PaymentTest extends TestCase
|
||||
|
||||
public function testStorePaymentWithZeroAmountField()
|
||||
{
|
||||
$client = Client::factory()->create(['company_id' =>$this->company->id, 'user_id' => $this->user->id]);
|
||||
$client = Client::factory()->create(['company_id' => $this->company->id, 'user_id' => $this->user->id]);
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $client->id,
|
||||
@ -1420,7 +1420,7 @@ class PaymentTest extends TestCase
|
||||
|
||||
public function testPaymentForInvoicesFromDifferentClients()
|
||||
{
|
||||
$client1 = Client::factory()->create(['company_id' =>$this->company->id, 'user_id' => $this->user->id]);
|
||||
$client1 = Client::factory()->create(['company_id' => $this->company->id, 'user_id' => $this->user->id]);
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $client1->id,
|
||||
@ -1429,7 +1429,7 @@ class PaymentTest extends TestCase
|
||||
]);
|
||||
|
||||
|
||||
$client2 = Client::factory()->create(['company_id' =>$this->company->id, 'user_id' => $this->user->id]);
|
||||
$client2 = Client::factory()->create(['company_id' => $this->company->id, 'user_id' => $this->user->id]);
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $client2->id,
|
||||
@ -1496,7 +1496,7 @@ class PaymentTest extends TestCase
|
||||
|
||||
public function testPaymentWithSameInvoiceMultipleTimes()
|
||||
{
|
||||
$client1 = Client::factory()->create(['company_id' =>$this->company->id, 'user_id' => $this->user->id]);
|
||||
$client1 = Client::factory()->create(['company_id' => $this->company->id, 'user_id' => $this->user->id]);
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $client1->id,
|
||||
@ -1549,7 +1549,7 @@ class PaymentTest extends TestCase
|
||||
|
||||
public function testStorePaymentWithCredits()
|
||||
{
|
||||
$client = Client::factory()->create(['company_id' =>$this->company->id, 'user_id' => $this->user->id]);
|
||||
$client = Client::factory()->create(['company_id' => $this->company->id, 'user_id' => $this->user->id]);
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $client->id,
|
||||
@ -1632,7 +1632,7 @@ class PaymentTest extends TestCase
|
||||
$settings = ClientSettings::defaults();
|
||||
$settings->currency_id = '2';
|
||||
|
||||
$client = Client::factory()->create(['company_id' =>$this->company->id, 'user_id' => $this->user->id]);
|
||||
$client = Client::factory()->create(['company_id' => $this->company->id, 'user_id' => $this->user->id]);
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $client->id,
|
||||
@ -1693,7 +1693,7 @@ class PaymentTest extends TestCase
|
||||
{
|
||||
$invoice = null;
|
||||
|
||||
$client = Client::factory()->create(['company_id' =>$this->company->id, 'user_id' => $this->user->id]);
|
||||
$client = Client::factory()->create(['company_id' => $this->company->id, 'user_id' => $this->user->id]);
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $client->id,
|
||||
@ -1778,7 +1778,7 @@ class PaymentTest extends TestCase
|
||||
{
|
||||
$invoice = null;
|
||||
|
||||
$client = Client::factory()->create(['company_id' =>$this->company->id, 'user_id' => $this->user->id]);
|
||||
$client = Client::factory()->create(['company_id' => $this->company->id, 'user_id' => $this->user->id]);
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $client->id,
|
||||
@ -1872,7 +1872,7 @@ class PaymentTest extends TestCase
|
||||
'date' => '2020/12/12',
|
||||
'number' => 'duplicate',
|
||||
];
|
||||
sleep(1);
|
||||
sleep(1);
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'X-API-SECRET' => config('ninja.api_secret'),
|
||||
@ -1880,7 +1880,7 @@ sleep(1);
|
||||
])->postJson('/api/v1/payments', $data);
|
||||
|
||||
$response->assertStatus(200);
|
||||
sleep(1);
|
||||
sleep(1);
|
||||
$response = $this->withHeaders([
|
||||
'X-API-SECRET' => config('ninja.api_secret'),
|
||||
'X-API-TOKEN' => $this->token,
|
||||
|
@ -38,7 +38,7 @@ class PaymentV2Test extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -130,7 +130,7 @@ class PaymentV2Test extends TestCase
|
||||
|
||||
public function testStorePaymentWithCreditsThenDeletingInvoices()
|
||||
{
|
||||
$client = Client::factory()->create(['company_id' =>$this->company->id, 'user_id' => $this->user->id, 'balance' => 20, 'paid_to_date' => 0]);
|
||||
$client = Client::factory()->create(['company_id' => $this->company->id, 'user_id' => $this->user->id, 'balance' => 20, 'paid_to_date' => 0]);
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $client->id,
|
||||
@ -258,7 +258,7 @@ class PaymentV2Test extends TestCase
|
||||
|
||||
public function testStorePaymentWithCreditsThenDeletingInvoicesAndThenPayments()
|
||||
{
|
||||
$client = Client::factory()->create(['company_id' =>$this->company->id, 'user_id' => $this->user->id, 'balance' => 100, 'paid_to_date' => 0]);
|
||||
$client = Client::factory()->create(['company_id' => $this->company->id, 'user_id' => $this->user->id, 'balance' => 100, 'paid_to_date' => 0]);
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $client->id,
|
||||
|
@ -36,7 +36,7 @@ class AutoUnappliedPaymentTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockUnitData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -94,10 +94,9 @@ class AutoUnappliedPaymentTest extends TestCase
|
||||
|
||||
// nlog($invoice->balance);
|
||||
|
||||
try{
|
||||
try {
|
||||
$invoice->service()->autoBill()->save();
|
||||
}
|
||||
catch(\Exception $e){
|
||||
} catch(\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
@ -157,8 +156,7 @@ class AutoUnappliedPaymentTest extends TestCase
|
||||
|
||||
try {
|
||||
$invoice->service()->autoBill()->save();
|
||||
}
|
||||
catch(\Exception $e) {
|
||||
} catch(\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ class CreditPaymentTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockUnitData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -29,7 +29,7 @@ class DeletePaymentTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockUnitData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -29,7 +29,7 @@ class StorePaymentValidationTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -31,7 +31,7 @@ class UnappliedPaymentDeleteTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockUnitData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -28,7 +28,7 @@ class UnappliedPaymentRefundTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockUnitData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -20,7 +20,8 @@ use Tests\TestCase;
|
||||
|
||||
class ExampleIntegrationTest extends TestCase
|
||||
{
|
||||
use MakesInvoiceValues, MockAccountData;
|
||||
use MakesInvoiceValues;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
|
@ -16,7 +16,6 @@ use Tests\TestCase;
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||
|
||||
|
||||
class CsvConversionTest extends TestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
@ -50,5 +49,3 @@ class CsvConversionTest extends TestCase
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -25,7 +25,7 @@ class PingTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->makeTestData();
|
||||
|
@ -25,7 +25,7 @@ class PreviewTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -34,7 +34,7 @@ class ProductTest extends TestCase
|
||||
|
||||
protected $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -34,7 +34,7 @@ class ProjectApiTest extends TestCase
|
||||
|
||||
protected $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -67,7 +67,7 @@ class PurchaseOrderTest extends TestCase
|
||||
event(new PurchaseOrderWasCreated($this->purchase_order, $this->company, Ninja::eventVars($this->company, $this->user)));
|
||||
|
||||
$ar = new ActivityRepository();
|
||||
$fields = new \stdClass;
|
||||
$fields = new \stdClass();
|
||||
$fields->user_id = $this->purchase_order->user_id;
|
||||
$fields->vendor_id = $this->purchase_order->vendor_id;
|
||||
$fields->company_id = $this->purchase_order->company_id;
|
||||
@ -126,7 +126,7 @@ class PurchaseOrderTest extends TestCase
|
||||
|
||||
|
||||
$data = [
|
||||
'ids' =>[$po->hashed_id],
|
||||
'ids' => [$po->hashed_id],
|
||||
'action' => 'archive',
|
||||
];
|
||||
|
||||
@ -137,7 +137,7 @@ class PurchaseOrderTest extends TestCase
|
||||
->assertStatus(200);
|
||||
|
||||
$data = [
|
||||
'ids' =>[$po->hashed_id],
|
||||
'ids' => [$po->hashed_id],
|
||||
'action' => 'restore',
|
||||
];
|
||||
|
||||
@ -148,7 +148,7 @@ class PurchaseOrderTest extends TestCase
|
||||
->assertStatus(200);
|
||||
|
||||
$data = [
|
||||
'ids' =>[$po->hashed_id],
|
||||
'ids' => [$po->hashed_id],
|
||||
'action' => 'delete',
|
||||
];
|
||||
|
||||
@ -160,7 +160,7 @@ class PurchaseOrderTest extends TestCase
|
||||
|
||||
|
||||
$data = [
|
||||
'ids' =>[$po->hashed_id],
|
||||
'ids' => [$po->hashed_id],
|
||||
'action' => 'restore',
|
||||
];
|
||||
|
||||
@ -172,7 +172,7 @@ class PurchaseOrderTest extends TestCase
|
||||
|
||||
|
||||
$data = [
|
||||
'ids' =>[],
|
||||
'ids' => [],
|
||||
'action' => 'archive',
|
||||
];
|
||||
|
||||
@ -183,7 +183,7 @@ class PurchaseOrderTest extends TestCase
|
||||
->assertStatus(302);
|
||||
|
||||
$data = [
|
||||
'ids' =>[$po->hashed_id],
|
||||
'ids' => [$po->hashed_id],
|
||||
'action' => '',
|
||||
];
|
||||
|
||||
@ -195,7 +195,7 @@ class PurchaseOrderTest extends TestCase
|
||||
|
||||
|
||||
$data = [
|
||||
'ids' =>[$po->hashed_id],
|
||||
'ids' => [$po->hashed_id],
|
||||
'action' => 'molly',
|
||||
];
|
||||
|
||||
|
@ -42,7 +42,7 @@ class QuoteReminderTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -112,7 +112,7 @@ class QuoteReminderTest extends TestCase
|
||||
|
||||
$this->token = \Illuminate\Support\Str::random(64);
|
||||
|
||||
$company_token = new CompanyToken;
|
||||
$company_token = new CompanyToken();
|
||||
$company_token->user_id = $this->user->id;
|
||||
$company_token->company_id = $this->company->id;
|
||||
$company_token->account_id = $this->account->id;
|
||||
|
@ -37,7 +37,7 @@ class QuoteTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -215,7 +215,7 @@ class QuoteTest extends TestCase
|
||||
'client_id' => $c->id,
|
||||
'status_id' => 2,
|
||||
'date' => now(),
|
||||
'line_items' =>[
|
||||
'line_items' => [
|
||||
[
|
||||
'type_id' => '2',
|
||||
'cost' => 200,
|
||||
|
@ -34,7 +34,7 @@ class RecurringExpenseApiTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -135,7 +135,7 @@ class RecurringExpenseApiTest extends TestCase
|
||||
'client_id' => $this->client->hashed_id,
|
||||
'number' => '123321',
|
||||
'frequency_id' => 5,
|
||||
'remaining_cycles' =>5,
|
||||
'remaining_cycles' => 5,
|
||||
'currency_id' => 34545435425
|
||||
];
|
||||
|
||||
@ -155,7 +155,7 @@ class RecurringExpenseApiTest extends TestCase
|
||||
'client_id' => $this->client->hashed_id,
|
||||
'number' => '123321',
|
||||
'frequency_id' => 5,
|
||||
'remaining_cycles' =>5,
|
||||
'remaining_cycles' => 5,
|
||||
'currency_id' => 1
|
||||
];
|
||||
|
||||
@ -175,7 +175,7 @@ class RecurringExpenseApiTest extends TestCase
|
||||
'client_id' => $this->client->hashed_id,
|
||||
'number' => '123321',
|
||||
'frequency_id' => 5,
|
||||
'remaining_cycles' =>5,
|
||||
'remaining_cycles' => 5,
|
||||
'currency_id' => null
|
||||
];
|
||||
|
||||
@ -199,7 +199,7 @@ class RecurringExpenseApiTest extends TestCase
|
||||
'client_id' => $this->client->hashed_id,
|
||||
'number' => '123321',
|
||||
'frequency_id' => 5,
|
||||
'remaining_cycles' =>5,
|
||||
'remaining_cycles' => 5,
|
||||
'currency_id' => ""
|
||||
];
|
||||
|
||||
@ -423,7 +423,7 @@ class RecurringExpenseApiTest extends TestCase
|
||||
'client_id' => $this->client->hashed_id,
|
||||
'number' => '123321',
|
||||
'frequency_id' => 5,
|
||||
'remaining_cycles' =>5,
|
||||
'remaining_cycles' => 5,
|
||||
];
|
||||
|
||||
$response = $this->withHeaders([
|
||||
|
@ -44,7 +44,7 @@ class RecurringInvoiceTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -26,7 +26,7 @@ class RecurringInvoicesCronTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -32,7 +32,7 @@ class RecurringQuoteTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -34,7 +34,7 @@ class RecurringQuotesTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -42,7 +42,7 @@ class RefundTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -82,7 +82,7 @@ class RefundTest extends TestCase
|
||||
|
||||
$payment_id = $arr['data']['id'];
|
||||
|
||||
$item = new InvoiceItem;
|
||||
$item = new InvoiceItem();
|
||||
$item->cost = 300;
|
||||
$item->quantity = 1;
|
||||
|
||||
@ -792,7 +792,7 @@ class RefundTest extends TestCase
|
||||
'balance' => 1000,
|
||||
]);
|
||||
|
||||
$item = new InvoiceItem;
|
||||
$item = new InvoiceItem();
|
||||
$item->cost = 1000;
|
||||
$item->quantity = 1;
|
||||
|
||||
@ -825,9 +825,9 @@ class RefundTest extends TestCase
|
||||
$this->assertNotNull($c);
|
||||
$this->assertEquals(2, $c->status_id);
|
||||
|
||||
$this->assertEquals($cl->id, $c->client_id);
|
||||
$this->assertEquals($cl->id, $c->client_id);
|
||||
|
||||
$this->assertEquals($cl->id, $i->client_id);
|
||||
$this->assertEquals($cl->id, $i->client_id);
|
||||
|
||||
$data = [
|
||||
'amount' => 900,
|
||||
|
@ -42,7 +42,7 @@ class ReminderTest extends TestCase
|
||||
|
||||
public $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -112,7 +112,7 @@ class ReminderTest extends TestCase
|
||||
|
||||
$this->token = \Illuminate\Support\Str::random(64);
|
||||
|
||||
$company_token = new CompanyToken;
|
||||
$company_token = new CompanyToken();
|
||||
$company_token->user_id = $this->user->id;
|
||||
$company_token->company_id = $this->company->id;
|
||||
$company_token->account_id = $this->account->id;
|
||||
@ -228,8 +228,7 @@ class ReminderTest extends TestCase
|
||||
$invoice = $invoice->fresh();
|
||||
|
||||
$x = (bool)$invoice->reminder1_sent;
|
||||
}
|
||||
while($x === false);
|
||||
} while($x === false);
|
||||
|
||||
$this->assertNotNull($invoice->reminder_last_sent);
|
||||
|
||||
@ -339,7 +338,7 @@ class ReminderTest extends TestCase
|
||||
public function testReminderInThePast()
|
||||
{
|
||||
|
||||
$translations = new \stdClass;
|
||||
$translations = new \stdClass();
|
||||
$translations->late_fee_added = "Fee added :date";
|
||||
|
||||
$settings = $this->company->settings;
|
||||
@ -377,7 +376,7 @@ class ReminderTest extends TestCase
|
||||
public function testsForTranslationsInReminders()
|
||||
{
|
||||
|
||||
$translations = new \stdClass;
|
||||
$translations = new \stdClass();
|
||||
$translations->late_fee_added = "Fee added :date";
|
||||
|
||||
$settings = $this->company->settings;
|
||||
@ -502,7 +501,7 @@ class ReminderTest extends TestCase
|
||||
|
||||
$travel_date = Carbon::parse($this->invoice->next_send_date);
|
||||
$x = false;
|
||||
for($x=0; $x<50; $x++) {
|
||||
for($x = 0; $x < 50; $x++) {
|
||||
|
||||
(new ReminderJob())->handle();
|
||||
|
||||
@ -511,7 +510,7 @@ class ReminderTest extends TestCase
|
||||
|
||||
$this->assertNotNull($this->invoice->reminder1_sent);
|
||||
$this->assertNotNull($this->invoice->reminder_last_sent);
|
||||
$x=true;
|
||||
$x = true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -36,7 +36,7 @@ class ReverseInvoiceTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -770,7 +770,7 @@ class SchedulerTest extends TestCase
|
||||
'name' => 'A different Name',
|
||||
'frequency_id' => 5,
|
||||
'next_run' => now()->addDays(2)->format('Y-m-d'),
|
||||
'template' =>'client_statement',
|
||||
'template' => 'client_statement',
|
||||
'parameters' => [],
|
||||
];
|
||||
|
||||
@ -788,7 +788,7 @@ class SchedulerTest extends TestCase
|
||||
'name' => 'A different Name',
|
||||
'frequency_id' => 5,
|
||||
'next_run' => now()->addDays(2)->format('Y-m-d'),
|
||||
'template' =>'client_statement',
|
||||
'template' => 'client_statement',
|
||||
'parameters' => [],
|
||||
];
|
||||
|
||||
|
@ -25,7 +25,7 @@ class SearchApiTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -29,7 +29,7 @@ class ShopInvoiceTest extends TestCase
|
||||
use MockAccountData;
|
||||
protected $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -27,7 +27,7 @@ class SystemLogApiTest extends TestCase
|
||||
use DatabaseTransactions;
|
||||
use MockAccountData;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -35,7 +35,7 @@ class TaskApiTest extends TestCase
|
||||
|
||||
private $faker;
|
||||
|
||||
protected function setUp() :void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -72,7 +72,7 @@ class TaskApiTest extends TestCase
|
||||
/*Flag which helps us know if there is a NEXT timelog*/
|
||||
$next = false;
|
||||
/* If there are more than 1 time log in the array, ensure the last timestamp is not zero*/
|
||||
if (count($new_array) >1 && $array[1] == 0) {
|
||||
if (count($new_array) > 1 && $array[1] == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -83,8 +83,8 @@ class TaskApiTest extends TestCase
|
||||
}
|
||||
|
||||
/* Find the next time log value - if it exists */
|
||||
if (array_key_exists($key+1, $new_array)) {
|
||||
$next = $new_array[$key+1];
|
||||
if (array_key_exists($key + 1, $new_array)) {
|
||||
$next = $new_array[$key + 1];
|
||||
}
|
||||
|
||||
/* check the next time log and ensure the start time is GREATER than the end time of the previous record */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user