forked from mollie/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Allow POS access for guests mollie#823
- Loading branch information
1 parent
edfeaba
commit 0bc9cf0
Showing
3 changed files
with
47 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
Test/Integration/Service/Mollie/PointOfSaleAvailabilityTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Mollie\Payment\Test\Integration\Service\Mollie; | ||
|
||
use Magento\Quote\Model\Quote; | ||
use Mollie\Payment\Service\Mollie\PointOfSaleAvailability; | ||
use Mollie\Payment\Test\Integration\IntegrationTestCase; | ||
|
||
class PointOfSaleAvailabilityTest extends IntegrationTestCase | ||
{ | ||
/** | ||
* @magentoDataFixture Magento/Sales/_files/quote.php | ||
* @return void | ||
*/ | ||
public function testDoesNotAllowAccessWhenSettingIsNotSet(): void | ||
{ | ||
$cart = $this->objectManager->create(Quote::class); | ||
$cart->load('test01', 'reserved_order_id'); | ||
|
||
/** @var \Mollie\Payment\Service\Mollie\PointOfSaleAvailability $instance */ | ||
$instance = $this->objectManager->get(PointOfSaleAvailability::class); | ||
|
||
$this->assertFalse($instance->isAvailable($cart)); | ||
} | ||
|
||
/** | ||
* @magentoConfigFixture default_store payment/mollie_methods_pointofsale/allowed_customer_groups 0 | ||
* @magentoDataFixture Magento/Sales/_files/quote.php | ||
* @return void | ||
*/ | ||
public function testAllowsNotLoggedInAccesWhenConfiguredProperly(): void | ||
{ | ||
$cart = $this->objectManager->create(Quote::class); | ||
$cart->load('test01', 'reserved_order_id'); | ||
|
||
/** @var \Mollie\Payment\Service\Mollie\PointOfSaleAvailability $instance */ | ||
$instance = $this->objectManager->get(PointOfSaleAvailability::class); | ||
|
||
$this->assertTrue($instance->isAvailable($cart)); | ||
} | ||
} |