tests for offline payments and paypal standard
This commit is contained in:
45
modules/PaypalStandard/Tests/Feature/SettingsTest.php
Normal file
45
modules/PaypalStandard/Tests/Feature/SettingsTest.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\PaypalStandard\Tests\Feature;
|
||||
|
||||
use Tests\Feature\FeatureTestCase;
|
||||
|
||||
class SettingsTest extends FeatureTestCase
|
||||
{
|
||||
public function testItShouldSeePaypalStandardInSettingsListPage()
|
||||
{
|
||||
$this->loginAs()
|
||||
->get(route('settings.index'))
|
||||
->assertStatus(200)
|
||||
->assertSeeText(trans('paypal-standard::general.description'));
|
||||
}
|
||||
|
||||
public function testItShouldSeePaypalStandardSettingsUpdatePage()
|
||||
{
|
||||
$this->loginAs()
|
||||
->get(route('settings.module.edit', ['alias' => 'paypal-standard']))
|
||||
->assertStatus(200);
|
||||
}
|
||||
|
||||
public function testItShouldUpdatePaypalStandardSettings()
|
||||
{
|
||||
$this->loginAs()
|
||||
->patch(route('settings.module.edit', ['alias' => 'paypal-standard']), $this->getRequest())
|
||||
->assertStatus(200);
|
||||
|
||||
$this->assertFlashLevel('success');
|
||||
}
|
||||
|
||||
public function getRequest()
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->name,
|
||||
'email' => $this->faker->safeEmail,
|
||||
'mode' => 'sandbox',
|
||||
'transaction' => 'sale',
|
||||
'customer' => 1,
|
||||
'debug' => 1,
|
||||
'order' => 1,
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user