1
0
Fork 0
mirror of synced 2025-04-03 22:03:34 +03:00
This commit is contained in:
Akolzin Dmitry 2018-04-23 14:22:20 +03:00
parent cdfad1ad6c
commit a6b08017ec
7 changed files with 42 additions and 25 deletions

24
.travis.yml Normal file
View file

@ -0,0 +1,24 @@
language: php
sudo: false
php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
env:
- WP_VERSION=latest WP_MULTISITE=0
before_script:
- bash tests/bin/install.sh wc_stripe_test root '' localhost $WP_VERSION
cache:
directories:
- node_modules
script: phpunit -c phpunit.xml.dist

View file

@ -7,6 +7,8 @@
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
verbose="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="true"
>
<testsuites>
@ -16,11 +18,11 @@
</testsuites>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./include</directory>
<file>retailcrm.php</file>
<file>uninstall.php</file>
<directory suffix=".php">src/include</directory>
<exclude>
<directory suffix=".php">./include/api</directory>
<directory suffix=".php">src/include/api</directory>
<file>src/retailcrm.php</file>
<file>src/uninstall.php</file>
</exclude>
</whitelist>
</filter>

View file

@ -32,7 +32,7 @@ if (!class_exists('WC_Retailcrm_Google_Analytics')) {
* @return string
*/
public function initialize_analytics() {
return "
return apply_filters('retailcrm_initialize_analytics' ,"
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
@ -51,7 +51,7 @@ if (!class_exists('WC_Retailcrm_Google_Analytics')) {
ga('set', 'dimension" . $this->options['ua_custom'] ."', getRetailCrmCookie('_ga'));
ga('send', 'pageview');
</script>
";
");
}
/**
@ -109,7 +109,7 @@ if (!class_exists('WC_Retailcrm_Google_Analytics')) {
";
}
return $js;
return apply_filters('retailcrm_send_analytics', $js);
}
}
}

View file

@ -65,7 +65,7 @@ if (!class_exists( 'WC_Integration_Retailcrm')) :
}
if (!class_exists('WC_Retailcrm_Plugin')) {
require_once (dirname(__FILE__) . '/include/class-wc-retailcrm-plugin.php');
require_once (dirname(__FILE__) . '/include/class-wc-retailcrm-plugin.php');
}
$plugin = WC_Retailcrm_Plugin::getInstance(__FILE__);

View file

@ -69,11 +69,9 @@ install_wp() {
}
install_woocommerce() {
cd $TRAVIS_BUILD_DIR
cd ..
cd /tmp
git clone https://github.com/woocommerce/woocommerce.git
cd woocommerce
git checkout $WC_VERSION
cd -
}
@ -132,15 +130,7 @@ install_db() {
mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA
}
#install_wc() {
#
# mkdir -p /tmp/wordpress/wp-content/plugins/woocommerce
# svn co --quiet https://plugins.svn.wordpress.org/woocommerce/trunk/ /tmp/wordpress/wp-content/plugins/woocommerce
#
#}
install_wp
install_test_suite
install_woocommerce
install_db
#install_wc

View file

@ -1,8 +1,8 @@
<?php
$_tests_dir = getenv( 'WP_TESTS_DIR' );
$_tests_dir = getenv('WP_TESTS_DIR');
if ( ! $_tests_dir ) {
if (!$_tests_dir) {
$_tests_dir = '/tmp/wordpress-tests-lib';
}
@ -15,15 +15,15 @@ function _manually_load_plugin() {
require $plugin_dir . 'woocommerce-retailcrm/src/include/class-wc-retailcrm-customers.php';
require $plugin_dir . 'woocommerce-retailcrm/src/include/class-wc-retailcrm-inventories.php';
require $plugin_dir . 'woocommerce-retailcrm/src/retailcrm.php';
require '/woocommerce/woocommerce.php';
require '/tmp/woocommerce/woocommerce.php';
}
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
tests_add_filter('muplugins_loaded', '_manually_load_plugin');
require $_tests_dir . '/includes/bootstrap.php';
require '/woocommerce/tests/bootstrap.php';
require '/tmp/woocommerce/tests/bootstrap.php';
$wc_tests_framework_base_dir = '/woocommerce/tests/framework/';
$wc_tests_framework_base_dir = '/tmp/woocommerce/tests/framework/';
require_once( $wc_tests_framework_base_dir . 'class-wc-mock-session-handler.php' );
require_once( $wc_tests_framework_base_dir . 'class-wc-unit-test-case.php' );

1
version Normal file
View file

@ -0,0 +1 @@
2.1.4