diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..60d9728
--- /dev/null
+++ b/.travis.yml
@@ -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
\ No newline at end of file
diff --git a/phpunit.xml b/phpunit.xml.dist
similarity index 69%
rename from phpunit.xml
rename to phpunit.xml.dist
index 5792b86..8057fd7 100644
--- a/phpunit.xml
+++ b/phpunit.xml.dist
@@ -7,6 +7,8 @@
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
verbose="true"
+ processIsolation="false"
+ stopOnFailure="false"
syntaxCheck="true"
>
@@ -16,11 +18,11 @@
- ./include
- retailcrm.php
- uninstall.php
+ src/include
- ./include/api
+ src/include/api
+ src/retailcrm.php
+ src/uninstall.php
diff --git a/src/include/class-wc-retailcrm-ga.php b/src/include/class-wc-retailcrm-ga.php
index 3404b1b..e791ae7 100644
--- a/src/include/class-wc-retailcrm-ga.php
+++ b/src/include/class-wc-retailcrm-ga.php
@@ -32,7 +32,7 @@ if (!class_exists('WC_Retailcrm_Google_Analytics')) {
* @return string
*/
public function initialize_analytics() {
- return "
+ return apply_filters('retailcrm_initialize_analytics' ,"
- ";
+ ");
}
/**
@@ -109,7 +109,7 @@ if (!class_exists('WC_Retailcrm_Google_Analytics')) {
";
}
- return $js;
+ return apply_filters('retailcrm_send_analytics', $js);
}
}
}
diff --git a/src/retailcrm.php b/src/retailcrm.php
index 96eec88..b557b6e 100644
--- a/src/retailcrm.php
+++ b/src/retailcrm.php
@@ -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__);
diff --git a/tests/bin/install.sh b/tests/bin/install.sh
index 69379a7..7fd64b6 100755
--- a/tests/bin/install.sh
+++ b/tests/bin/install.sh
@@ -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
diff --git a/tests/phpunit/bootstrap.php b/tests/phpunit/bootstrap.php
index 5ab7add..8f4d105 100644
--- a/tests/phpunit/bootstrap.php
+++ b/tests/phpunit/bootstrap.php
@@ -1,8 +1,8 @@