mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Data seeding: Stripe
This commit is contained in:
parent
e5e9b2151c
commit
9178a70fed
@ -36,6 +36,11 @@ class ACHTest extends DuskTestCase
|
||||
->auth();
|
||||
});
|
||||
|
||||
$this->disableCompanyGateways();
|
||||
|
||||
// Enable Stripe.
|
||||
CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->restore();
|
||||
|
||||
// Enable ACH.
|
||||
$cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail();
|
||||
$fees_and_limits = $cg->fees_and_limits;
|
||||
@ -63,7 +68,7 @@ class ACHTest extends DuskTestCase
|
||||
->type('#account-number', '000123456789')
|
||||
->check('#accept-terms')
|
||||
->press('Add Payment Method')
|
||||
->waitForText('ACH (Verification)')
|
||||
->waitForText('ACH (Verification)', 60)
|
||||
->type('@verification-1st', '32')
|
||||
->type('@verification-2nd', '45')
|
||||
->press('Complete Verification')
|
||||
|
@ -37,6 +37,11 @@ class AlipayTest extends DuskTestCase
|
||||
->auth();
|
||||
});
|
||||
|
||||
$this->disableCompanyGateways();
|
||||
|
||||
// Enable Stripe.
|
||||
CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->restore();
|
||||
|
||||
// Enable Alipay.
|
||||
$cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail();
|
||||
$fees_and_limits = $cg->fees_and_limits;
|
||||
|
@ -35,6 +35,11 @@ class CreditCardTest extends DuskTestCase
|
||||
->auth();
|
||||
});
|
||||
|
||||
$this->disableCompanyGateways();
|
||||
|
||||
// Enable Stripe.
|
||||
CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->restore();
|
||||
|
||||
$cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail();
|
||||
$fees_and_limits = $cg->fees_and_limits;
|
||||
$fees_and_limits->{GatewayType::CREDIT_CARD} = new FeesAndLimits();
|
||||
|
@ -36,6 +36,11 @@ class SofortTest extends DuskTestCase
|
||||
->auth();
|
||||
});
|
||||
|
||||
$this->disableCompanyGateways();
|
||||
|
||||
// Enable Stripe.
|
||||
CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->restore();
|
||||
|
||||
// Enable SOFORT.
|
||||
$cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail();
|
||||
$fees_and_limits = $cg->fees_and_limits;
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Tests;
|
||||
|
||||
use App\Models\CompanyGateway;
|
||||
use Facebook\WebDriver\Chrome\ChromeOptions;
|
||||
use Facebook\WebDriver\Remote\DesiredCapabilities;
|
||||
use Facebook\WebDriver\Remote\RemoteWebDriver;
|
||||
@ -58,4 +59,14 @@ abstract class DuskTestCase extends BaseTestCase
|
||||
return isset($_SERVER['DUSK_HEADLESS_DISABLED']) ||
|
||||
isset($_ENV['DUSK_HEADLESS_DISABLED']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable all company gateways, test classes should enable them per need.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function disableCompanyGateways()
|
||||
{
|
||||
CompanyGateway::where('company_id', 1)->delete();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user