init
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use Magento\Customer\Model\CustomerRegistry;
|
||||
use Magento\Integration\Api\CustomerTokenServiceInterface;
|
||||
use Magento\TestFramework\Helper\Bootstrap;
|
||||
use Magento\TestFramework\Workaround\Override\Fixture\Resolver;
|
||||
|
||||
Resolver::getInstance()->requireDataFixture('Magento/Customer/_files/customer.php');
|
||||
|
||||
$objectManager = Bootstrap::getObjectManager();
|
||||
/** @var CustomerRegistry $customerRegistry */
|
||||
$customerRegistry = $objectManager->create(CustomerRegistry::class);
|
||||
$customer = $customerRegistry->retrieve(1);
|
||||
/** @var CustomerTokenServiceInterface $customerTokenService */
|
||||
$customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
|
||||
|
||||
$customerTokenService->createCustomerAccessToken($customer->getEmail(), 'password');
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use Magento\TestFramework\Workaround\Override\Fixture\Resolver;
|
||||
|
||||
Resolver::getInstance()->requireDataFixture('Magento/Customer/_files/customer_rollback.php');
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use Magento\Integration\Api\IntegrationServiceInterface;
|
||||
use Magento\TestFramework\Helper\Bootstrap;
|
||||
|
||||
$objectManager = Bootstrap::getObjectManager();
|
||||
$integrationService = $objectManager->get(IntegrationServiceInterface::class);
|
||||
|
||||
$data = [
|
||||
'name' => 'Fixture Integration',
|
||||
'email' => 'john.doe@example.com',
|
||||
'endpoint' => 'https://example.com/endpoint',
|
||||
'identity_link_url' => 'https://example.com/link',
|
||||
'all_resources' => 0,
|
||||
];
|
||||
$integrationService->create($data);
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use Magento\TestFramework\Workaround\Override\Fixture\Resolver;
|
||||
|
||||
Resolver::getInstance()->requireDataFixture('Magento/Integration/_files/integration_all_permissions_rollback.php');
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $integration \Magento\Integration\Model\Integration */
|
||||
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
|
||||
$integration = $objectManager->create(\Magento\Integration\Model\Integration::class);
|
||||
$integration->setName('Fixture Integration')->save();
|
||||
|
||||
/** Grant permissions to integrations */
|
||||
/** @var \Magento\Integration\Api\AuthorizationServiceInterface */
|
||||
$authorizationService = $objectManager->create(\Magento\Integration\Api\AuthorizationServiceInterface::class);
|
||||
$authorizationService->grantAllPermissions($integration->getId());
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $integration \Magento\Integration\Model\Integration */
|
||||
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
|
||||
$integration = $objectManager->create(\Magento\Integration\Model\Integration::class);
|
||||
$integration->load('Fixture Integration', 'name');
|
||||
if ($integration->getId()) {
|
||||
$integration->delete();
|
||||
}
|
||||
Reference in New Issue
Block a user