/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
dev/tests/integration/testsuite/Magento/Integration/Model/ResourceModel/IntegrationTest.php
50 строк
2 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 10:44
22 окт 2025, 10:44
264bea2
Код
Авторство
О чём код?
<?php /** * Copyright 2015 Adobe * All Rights Reserved. */ namespace Magento\Integration\Model\ResourceModel; /** * Integration test for \Magento\Integration\Model\ResourceModel\Integration */ class IntegrationTest extends \PHPUnit\Framework\TestCase { /** * @var \Magento\Integration\Model\Integration */ protected $integration; /** * @var \Magento\Integration\Model\Oauth\Consumer */ protected $consumer; protected function setUp(): void { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $this->consumer = $objectManager->create(\Magento\Integration\Model\Oauth\Consumer::class); $this->consumer->setData( [ // md5() here just to generate unique string // phpcs:disable Magento2.Security.InsecureFunction 'key' => md5(uniqid()), 'secret' => md5(uniqid()), // phpcs:enable 'callback_url' => 'http://example.com/callback', 'rejected_callback_url' => 'http://example.com/rejectedCallback' ] )->save(); $this->integration = $objectManager->create(\Magento\Integration\Model\Integration::class); $this->integration->setName('Test Integration') ->setConsumerId($this->consumer->getId()) ->setStatus(\Magento\Integration\Model\Integration::STATUS_ACTIVE) ->save(); } public function testLoadActiveIntegrationByConsumerId() { $integration = $this->integration->getResource()->selectActiveIntegrationByConsumerId($this->consumer->getId()); $this->assertEquals($this->integration->getId(), $integration['integration_id']); } }