Skip to content

Commit cc0b1cd

Browse files
committed
Fix static tests
1 parent 89808ed commit cc0b1cd

File tree

3 files changed

+10
-121
lines changed

3 files changed

+10
-121
lines changed

app/code/Magento/VaultGraphQl/Model/Resolver/PaymentTokens.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Magento\Framework\GraphQl\Config\Element\Field;
1111
use Magento\Framework\GraphQl\Query\ResolverInterface;
1212
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
13-
use Magento\VaultGraphQl\Model\VisibleTokenRetriever;
13+
use Magento\Vault\Model\PaymentTokenManagement;
1414
use Magento\CustomerGraphQl\Model\Customer\CheckCustomerAccount;
1515

1616
/**
@@ -19,24 +19,24 @@
1919
class PaymentTokens implements ResolverInterface
2020
{
2121
/**
22-
* @var VisibleTokenRetriever
22+
* @var PaymentTokenManagement
2323
*/
24-
private $visibleTokenRetriever;
24+
private $paymentTokenManagement;
2525

2626
/**
2727
* @var CheckCustomerAccount
2828
*/
2929
private $checkCustomerAccount;
3030

3131
/**
32-
* @param VisibleTokenRetriever $visibleTokenRetriever
32+
* @param PaymentTokenManagement $paymentTokenManagement
3333
* @param CheckCustomerAccount $checkCustomerAccount
3434
*/
3535
public function __construct(
36-
VisibleTokenRetriever $visibleTokenRetriever,
36+
PaymentTokenManagement $paymentTokenManagement,
3737
CheckCustomerAccount $checkCustomerAccount
3838
) {
39-
$this->visibleTokenRetriever = $visibleTokenRetriever;
39+
$this->paymentTokenManagement = $paymentTokenManagement;
4040
$this->checkCustomerAccount = $checkCustomerAccount;
4141
}
4242

@@ -55,7 +55,7 @@ public function resolve(
5555

5656
$this->checkCustomerAccount->execute($currentUserId, $currentUserType);
5757

58-
$tokens = $this->visibleTokenRetriever->getVisibleAvailableTokens($currentUserId);
58+
$tokens = $this->paymentTokenManagement->getVisibleAvailableTokens($currentUserId);
5959
$result = [];
6060

6161
foreach ($tokens as $token) {

app/code/Magento/VaultGraphQl/Model/VisibleTokenRetriever.php

Lines changed: 0 additions & 110 deletions
This file was deleted.

dev/tests/api-functional/testsuite/Magento/GraphQl/Vault/CustomerPaymentTokensTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Magento\Integration\Api\CustomerTokenServiceInterface;
1111
use Magento\TestFramework\Helper\Bootstrap;
1212
use Magento\TestFramework\TestCase\GraphQlAbstract;
13-
use Magento\VaultGraphQl\Model\VisibleTokenRetriever;
13+
use Magento\Vault\Model\PaymentTokenManagement;
1414
use Magento\Vault\Model\ResourceModel\PaymentToken as TokenResource;
1515
use Magento\Vault\Model\ResourceModel\PaymentToken\CollectionFactory;
1616

@@ -22,7 +22,7 @@ class CustomerPaymentTokensTest extends GraphQlAbstract
2222
private $customerTokenService;
2323

2424
/**
25-
* @var VisibleTokenRetriever
25+
* @var PaymentTokenManagement
2626
*/
2727
private $paymentTokenManagement;
2828

@@ -41,7 +41,7 @@ protected function setUp()
4141
parent::setUp();
4242

4343
$this->customerTokenService = Bootstrap::getObjectManager()->get(CustomerTokenServiceInterface::class);
44-
$this->paymentTokenManagement = Bootstrap::getObjectManager()->get(VisibleTokenRetriever::class);
44+
$this->paymentTokenManagement = Bootstrap::getObjectManager()->get(PaymentTokenManagement::class);
4545
$this->tokenResource = Bootstrap::getObjectManager()->get(TokenResource::class);
4646
$this->tokenCollectionFactory = Bootstrap::getObjectManager()->get(CollectionFactory::class);
4747
}
@@ -151,7 +151,6 @@ public function testDeletePaymentToken()
151151
$this->assertArrayHasKey('type', $token);
152152
// Validate gateway token is NOT returned
153153
$this->assertArrayNotHasKey('gateway_token', $token);
154-
155154
}
156155

157156
/**

0 commit comments

Comments
 (0)