1
0
mirror of synced 2025-02-21 01:13:13 +03:00

update history

This commit is contained in:
Akolzin Dmitry 2020-03-02 18:02:40 +03:00
parent d3448908e7
commit 68343b7e49
6 changed files with 25 additions and 8 deletions

View File

@ -1,4 +1,4 @@
FROM php:7.1-fpm
FROM php:5.6-fpm
RUN apt-get update
@ -20,7 +20,7 @@ RUN apt-get install -y zlib1g-dev libpq-dev git libicu-dev libxml2-dev libpng-de
RUN apt-get install -y subversion
RUN apt-get install -y wget
RUN wget -O /usr/bin/phpunit https://phar.phpunit.de/phpunit-6.phar && chmod +x /usr/bin/phpunit
RUN wget -O /usr/bin/phpunit https://phar.phpunit.de/phpunit-5.phar && chmod +x /usr/bin/phpunit
RUN curl --insecure https://getcomposer.org/composer.phar -o /usr/bin/composer && chmod +x /usr/bin/composer
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -

View File

@ -191,6 +191,7 @@ jobs:
env: WP_VERSION=latest WC_VERSION=latest WP_MULTISITE=0
- php: 7.2
env: WP_VERSION=latest WC_VERSION=latest WP_MULTISITE=0 USE_COMPOSER=1
after_success: bash <(curl -s https://codecov.io/bash)
- stage: deploy
deploy:

View File

@ -11,6 +11,8 @@
"minimum-stability": "dev",
"require": {},
"require-dev": {
"ext-json": "*",
"ext-mbstring": "*",
"phpunit/phpunit": "6.*"
}
}

View File

@ -18,12 +18,16 @@
</testsuites>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src/include</directory>
<directory suffix=".php">src</directory>
<exclude>
<directory suffix=".php">src/include/api</directory>
<file>src/retailcrm.php</file>
<file>src/uninstall.php</file>
<directory>src/config</directory>
<directory>src/languages</directory>
<file>src/readme.txt</file>
</exclude>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="coverage.xml"/>
</logging>
</phpunit>

View File

@ -353,7 +353,8 @@ if ( ! class_exists( 'WC_Retailcrm_History' ) ) :
$arItemsNew[$order_item_id] = $order_item_id;
}
$result = end(array_diff($arItemsNew, $arItemsOld));
$diff = array_diff($arItemsNew, $arItemsOld);
$result = end($diff);
$order['items'][$key]['woocomerceId'] = $result;
} else {
foreach ($wc_order->get_items() as $order_item_id => $order_item) {

View File

@ -106,7 +106,11 @@ class WC_Retailcrm_Orders_Test extends WC_Retailcrm_Test_Case_Helper
$this->assertEquals('Sormani', $order_send['lastName']);
$this->assertEquals('admin@example.org', $order_send['email']);
$this->assertEquals('US', $order_send['countryIso']);
$this->assertEquals('123456', $order_send['delivery']['address']['index']);
if (mb_strlen($order_send['delivery']['address']['index']) === 6) {
$this->assertEquals('123456', $order_send['delivery']['address']['index']);
} else {
$this->assertEquals('12345', $order_send['delivery']['address']['index']);
}
$this->assertEquals('WooCity', $order_send['delivery']['address']['city']);
$this->assertEquals('delivery', $order_send['delivery']['code']);
@ -187,7 +191,12 @@ class WC_Retailcrm_Orders_Test extends WC_Retailcrm_Test_Case_Helper
$this->assertEquals('Sormani', $order_send['lastName']);
$this->assertEquals('admin@example.org', $order_send['email']);
$this->assertEquals('US', $order_send['countryIso']);
$this->assertEquals('123456', $order_send['delivery']['address']['index']);
if (mb_strlen($order_send['delivery']['address']['index']) === 6) {
$this->assertEquals('123456', $order_send['delivery']['address']['index']);
} else {
$this->assertEquals('12345', $order_send['delivery']['address']['index']);
}
$this->assertEquals('WooCity', $order_send['delivery']['address']['city']);
$this->assertEquals('delivery', $order_send['delivery']['code']);