We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit d8743168 authored by Marcos Garcia's avatar Marcos Garcia Committed by GitHub

Fix Adyen\DataTest (#511)

* Fix Adyen\DataTest

This one is a bit more complex. DataTest depends on some external classes from Magento, so I set up a config and a bootstrap files for testing. While I was at this, I also made the dependencies a bit more strict.

* Update php requirement to match with Magento 2.2.8
parent aa84ab16
......@@ -50,6 +50,15 @@ class DataTest extends \PHPUnit\Framework\TestCase
$notificationFactory = $this->getSimpleMock(\Adyen\Payment\Model\ResourceModel\Notification\CollectionFactory::class);
$taxConfig = $this->getSimpleMock(\Magento\Tax\Model\Config::class);
$taxCalculation = $this->getSimpleMock(\Magento\Tax\Model\Calculation::class);
$productMetadata = $this->getSimpleMock(\Magento\Framework\App\ProductMetadata::class);
$adyenLogger = $this->getSimpleMock(\Adyen\Payment\Logger\AdyenLogger::class);
$storeManager = $this->getSimpleMock(\Magento\Store\Model\StoreManager::class);
$cache = $this->getSimpleMock(\Magento\Framework\App\CacheInterface::class);
$billingAgreementFactory = $this->getSimpleMock(\Adyen\Payment\Model\Billing\AgreementFactory::class);
$agreementResourceModel = $this->getSimpleMock(\Adyen\Payment\Model\ResourceModel\Billing\Agreement::class);
$localeResolver = $this->getSimpleMock(\Magento\Framework\Locale\ResolverInterface::class);
$config = $this->getSimpleMock(\Magento\Framework\App\Config\ScopeConfigInterface::class);
$helperBackend = $this->getSimpleMock(\Magento\Backend\Helper\Data::class);
$this->dataHelper = new \Adyen\Payment\Helper\Data(
$context,
......@@ -62,7 +71,16 @@ class DataTest extends \PHPUnit\Framework\TestCase
$assetSource,
$notificationFactory,
$taxConfig,
$taxCalculation
$taxCalculation,
$productMetadata,
$adyenLogger,
$storeManager,
$cache,
$billingAgreementFactory,
$agreementResourceModel,
$localeResolver,
$config,
$helperBackend
);
}
......
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment Module
*
* Copyright (c) 2019 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*
* Author: Adyen <magento@adyen.com>
*/
require __DIR__.'/../vendor/autoload.php';
require __DIR__.'/../../../../vendor/autoload.php';
<!--
~ ######
~ ######
~ ############ ####( ###### #####. ###### ############ ############
~ ############# #####( ###### #####. ###### ############# #############
~ ###### #####( ###### #####. ###### ##### ###### ##### ######
~ ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
~ ###### ###### #####( ###### #####. ###### ##### ##### ######
~ ############# ############# ############# ############# ##### ######
~ ############ ############ ############# ############ ##### ######
~ ######
~ #############
~ ############
~
~ Adyen Payment Module
~
~ Copyright (c) 2019 Adyen B.V.
~ This file is open source and available under the MIT license.
~ See the LICENSE file for more info.
~
~ Author: Adyen <magento@adyen.com>
-->
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.3/phpunit.xsd"
bootstrap="./bootstrap.php"
>
<testsuites>
<testsuite name="default">
<directory>.</directory>
</testsuite>
</testsuites>
</phpunit>
......@@ -16,7 +16,11 @@
"require": {
"adyen/php-api-library": "~2.1",
"magento/framework": ">=101.0.8 <102 || >=102.0.1",
"magento/module-vault": "101.*"
"magento/module-vault": "101.*",
"php": "~7.0.13|~7.1.0"
},
"require-dev": {
"phpunit/phpunit": "~6.5.0"
},
"autoload": {
"files": [
......@@ -30,5 +34,11 @@
"psr-4": {
"Adyen\\Payment\\Tests\\": "tests/"
}
},
"scripts": {
"test": [
"Composer\\Config::disableProcessTimeout",
"vendor/bin/phpunit -c Test/phpunit.xml"
]
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment