ltsecurityinc安防产品在线商城代码
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Paypal\Controller\Adminhtml\Billing\Agreement;
|
||||
|
||||
/**
|
||||
* @magentoAppArea adminhtml
|
||||
*/
|
||||
class CancelTest extends \Magento\TestFramework\TestCase\AbstractBackendController
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->resource = 'Magento_Paypal::actions_manage';
|
||||
$this->uri = 'backend/paypal/billing_agreement/cancel';
|
||||
parent::setUp();
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Paypal\Controller\Adminhtml\Billing\Agreement;
|
||||
|
||||
/**
|
||||
* @magentoAppArea adminhtml
|
||||
*/
|
||||
class DeleteTest extends \Magento\TestFramework\TestCase\AbstractBackendController
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->resource = 'Magento_Paypal::actions_manage';
|
||||
$this->uri = 'backend/paypal/billing_agreement/delete';
|
||||
parent::setUp();
|
||||
}
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Paypal\Controller\Adminhtml\Billing\Agreement;
|
||||
|
||||
use Magento\TestFramework\Helper\Bootstrap;
|
||||
|
||||
/**
|
||||
* @magentoAppArea adminhtml
|
||||
*/
|
||||
class GridTest extends \Magento\TestFramework\TestCase\AbstractBackendController
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->resource = 'Magento_Paypal::billing_agreement_actions_view';
|
||||
$this->uri = 'backend/paypal/billing_agreement/grid';
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
/**
|
||||
* @magentoDataFixture Magento/Customer/_files/customer.php
|
||||
* @magentoDataFixture Magento/Paypal/_files/billing_agreement.php
|
||||
*/
|
||||
public function testAclHasAccess()
|
||||
{
|
||||
/** @var $session \Magento\Backend\Model\Session */
|
||||
Bootstrap::getObjectManager()->create(\Magento\Backend\Model\Session::class);
|
||||
|
||||
parent::testAclHasAccess();
|
||||
|
||||
$response = $this->getResponse();
|
||||
|
||||
$this->assertEquals(
|
||||
1,
|
||||
\Magento\TestFramework\Helper\Xpath::getElementsCountForXpath(
|
||||
'//button[@type="button" and @title="Reset Filter"]',
|
||||
$response->getBody()
|
||||
),
|
||||
"Response for billing agreement grid doesn't contain 'Reset Filter' button"
|
||||
);
|
||||
|
||||
$this->assertEquals(
|
||||
1,
|
||||
\Magento\TestFramework\Helper\Xpath::getElementsCountForXpath(
|
||||
'//*[@id="billing_agreements"]',
|
||||
$response->getBody()
|
||||
),
|
||||
"Response for billing agreement grid doesn't contain grid"
|
||||
);
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Paypal\Controller\Adminhtml\Billing\Agreement;
|
||||
|
||||
/**
|
||||
* @magentoAppArea adminhtml
|
||||
*/
|
||||
class IndexTest extends \Magento\TestFramework\TestCase\AbstractBackendController
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->resource = 'Magento_Paypal::billing_agreement_actions_view';
|
||||
$this->uri = 'backend/paypal/billing_agreement/index';
|
||||
parent::setUp();
|
||||
}
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Paypal\Controller\Adminhtml\Billing\Agreement;
|
||||
|
||||
use Magento\TestFramework\Helper\Bootstrap;
|
||||
|
||||
/**
|
||||
* @magentoAppArea adminhtml
|
||||
*/
|
||||
class ViewTest extends \Magento\TestFramework\TestCase\AbstractBackendController
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->resource = 'Magento_Paypal::billing_agreement_actions_view';
|
||||
$this->uri = 'backend/paypal/billing_agreement/view';
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
/**
|
||||
* @magentoDataFixture Magento/Customer/_files/customer.php
|
||||
* @magentoDataFixture Magento/Paypal/_files/billing_agreement.php
|
||||
*/
|
||||
public function testAclHasAccess()
|
||||
{
|
||||
/** @var \Magento\Paypal\Model\ResourceModel\Billing\Agreement\Collection $billingAgreementCollection */
|
||||
$billingAgreementCollection = Bootstrap::getObjectManager()->create(
|
||||
\Magento\Paypal\Model\ResourceModel\Billing\Agreement\Collection::class
|
||||
);
|
||||
$agreementId = $billingAgreementCollection->getFirstItem()->getId();
|
||||
$this->uri = $this->uri . '/agreement/' . $agreementId;
|
||||
|
||||
parent::testAclHasAccess();
|
||||
|
||||
$this->assertEquals(
|
||||
1,
|
||||
\Magento\TestFramework\Helper\Xpath::getElementsCountForXpath(
|
||||
'//a[@name="billing_agreement_info"]',
|
||||
$this->getResponse()->getBody()
|
||||
),
|
||||
"Response for billing agreement info doesn't contain billing agreement info tab"
|
||||
);
|
||||
|
||||
$this->assertEquals(
|
||||
1,
|
||||
\Magento\TestFramework\Helper\Xpath::getElementsCountForXpath(
|
||||
'//a[contains(text(), "customer@example.com")]',
|
||||
$this->getResponse()->getBody()
|
||||
),
|
||||
"Response for billing agreement info doesn't contain Customer info"
|
||||
);
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Paypal\Controller\Adminhtml\Billing;
|
||||
|
||||
use Magento\TestFramework\Helper\Bootstrap;
|
||||
|
||||
/**
|
||||
* Test class for \Magento\Paypal\Controller\Adminhtml\Billing\Agreement
|
||||
*
|
||||
* @magentoAppArea adminhtml
|
||||
*/
|
||||
class AgreementTest extends \Magento\TestFramework\TestCase\AbstractBackendController
|
||||
{
|
||||
/**
|
||||
* @magentoDataFixture Magento/Customer/_files/customer.php
|
||||
* @magentoDataFixture Magento/Paypal/_files/billing_agreement.php
|
||||
*/
|
||||
public function testCustomerGrid()
|
||||
{
|
||||
$this->dispatch('backend/paypal/billing_agreement/customergrid/id/1');
|
||||
$this->assertEquals(
|
||||
1,
|
||||
\Magento\TestFramework\Helper\Xpath::getElementsCountForXpath(
|
||||
'//th[contains(@class,"col-reference_id")]',
|
||||
$this->getResponse()->getBody()
|
||||
),
|
||||
"Response for billing agreement orders doesn't contain billing agreement customers grid"
|
||||
);
|
||||
$this->assertEquals(
|
||||
1,
|
||||
\Magento\TestFramework\Helper\Xpath::getElementsCountForXpath(
|
||||
'//td[contains(text(), "REF-ID-TEST-678")]',
|
||||
$this->getResponse()->getBody()
|
||||
),
|
||||
"Response for billing agreement info doesn't contain reference ID"
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user