From 9d1bf1e7d7b68334f444655926fbbb9ddea872a8 Mon Sep 17 00:00:00 2001 From: s-hinse Date: Mon, 1 Feb 2016 17:24:18 +0100 Subject: [PATCH 1/6] updated paths, removed integration test calls --- phpunit.xml.dist | 5 +---- src/inc/Init.php | 6 +++--- test/bootstrap.php | 32 ++++++-------------------------- 3 files changed, 10 insertions(+), 33 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 59050b9..e0478a8 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -6,13 +6,10 @@ convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" - > +> ./test/UnitTests - - ./test/IntegrationTests - \ No newline at end of file diff --git a/src/inc/Init.php b/src/inc/Init.php index 6e908bd..6151758 100644 --- a/src/inc/Init.php +++ b/src/inc/Init.php @@ -85,7 +85,7 @@ public function register_plugin_pages() { $cap = apply_filters( 'insr-capability', 'install_plugins' ); add_submenu_page( 'tools.php', __( 'Backup Database', 'insr' ), - __( 'Backup Database', 'insr' ), $cap, 'db_backup', + __( 'Search & Replace', 'insr' ), $cap, 'db_backup', array( $this, 'show_db_backup_page' ) ); add_submenu_page( 'tools.php', __( 'Replace Domain URL', 'insr' ), @@ -93,7 +93,7 @@ public function register_plugin_pages() { array( $this, 'show_replace_domain_page' ) ); add_submenu_page( 'tools.php', __( 'Search & Replace', 'insr' ), - __( 'Search & Replace', 'insr' ), $cap, 'inpsyde_search_replace', + __( 'Search & Replace Page', 'insr' ), $cap, 'inpsyde_search_replace', array( $this, 'show_search_replace_page' ) ); add_submenu_page( 'tools.php', __( 'SQL Import', 'insr' ), @@ -111,7 +111,7 @@ public function register_plugin_pages() { */ public function remove_submenu_pages() { - remove_submenu_page( 'tools.php', 'db_backup' ); + remove_submenu_page( 'tools.php', 'inpsyde_search_replace' ); remove_submenu_page( 'tools.php', 'sql_import' ); remove_submenu_page( 'tools.php', 'replace_domain' ); remove_submenu_page( 'tools.php', 'credits' ); diff --git a/test/bootstrap.php b/test/bootstrap.php index dc0380e..6010ff4 100644 --- a/test/bootstrap.php +++ b/test/bootstrap.php @@ -7,30 +7,10 @@ if ( file_exists( $composer_file ) ) require_once $composer_file; -require_once $base_dir . './inc/Autoloader.php'; -require_once $base_dir . './inc/Replace.php'; -require_once $base_dir . './inc/DatabaseExporter.php'; -require_once $base_dir. './inc/DatabaseManager.php'; -require_once $base_dir. './inc/Admin.php'; -require_once $base_dir . './inc/DatabaseImporter.php'; +require_once $base_dir . './src/inc/Autoloader.php'; +require_once $base_dir . './src/inc/Replace.php'; +require_once $base_dir . './src/inc/DatabaseExporter.php'; +require_once $base_dir. './src/inc/DatabaseManager.php'; +require_once $base_dir. './src/inc/Admin.php'; +require_once $base_dir . './src/inc/DatabaseImporter.php'; - -// set up integration tests with wp-tests testsuite - - - -//set path to your wp-tests directory here -$tests_dir = 'D:\web\wp-tests\wordpress-dev\tests\phpunit'; -define( 'WP_TESTS_DIR',$tests_dir); -define ('TEST_PLUGIN_FILE',$base_dir . './inspyde-search-replace.php'); -echo TEST_PLUGIN_FILE; - -require_once $tests_dir . '/includes/functions.php'; -function _manually_load_plugin() { - require TEST_PLUGIN_FILE; -} -tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' ); -require $tests_dir . '/includes/bootstrap.php'; - -activate_plugin('search-and-replace','inpsyde-search-replace.php'); -echo "search & replace plugin activated \n"; \ No newline at end of file From 8d903ed133d0e734040eb92def85b5f26f88494b Mon Sep 17 00:00:00 2001 From: s-hinse Date: Mon, 1 Feb 2016 17:46:12 +0100 Subject: [PATCH 2/6] use autoloader for tests --- test/bootstrap.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/bootstrap.php b/test/bootstrap.php index 6010ff4..7678ff3 100644 --- a/test/bootstrap.php +++ b/test/bootstrap.php @@ -1,4 +1,5 @@ register(); + From 6d0e9b12d23a7e7a2a5bda2dcee34e50ce080ab5 Mon Sep 17 00:00:00 2001 From: s-hinse Date: Mon, 1 Feb 2016 17:47:19 +0100 Subject: [PATCH 3/6] add .travis.yml --- .travis..yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .travis..yml diff --git a/.travis..yml b/.travis..yml new file mode 100644 index 0000000..c3ddebf --- /dev/null +++ b/.travis..yml @@ -0,0 +1,8 @@ +language: php +php: + - '5.4' + - '5.5' + - '5.6' + - '7.0' + - hhvm + - nightly \ No newline at end of file From f718849ffb309d5d05a6c708808d02b5287df496 Mon Sep 17 00:00:00 2001 From: s-hinse Date: Mon, 1 Feb 2016 17:52:02 +0100 Subject: [PATCH 4/6] push, activate travis --- .travis..yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis..yml b/.travis..yml index c3ddebf..8579e47 100644 --- a/.travis..yml +++ b/.travis..yml @@ -5,4 +5,4 @@ php: - '5.6' - '7.0' - hhvm - - nightly \ No newline at end of file + - nightly From 9cbc01e24f49e31a089104916960d41ca8984ca6 Mon Sep 17 00:00:00 2001 From: s-hinse Date: Mon, 1 Feb 2016 17:57:33 +0100 Subject: [PATCH 5/6] correct typo --- .travis..yml => .travis.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .travis..yml => .travis.yml (100%) diff --git a/.travis..yml b/.travis.yml similarity index 100% rename from .travis..yml rename to .travis.yml From 6763aaf356555dde0acd9768907d330ae2d44d2a Mon Sep 17 00:00:00 2001 From: s-hinse Date: Mon, 1 Feb 2016 18:15:20 +0100 Subject: [PATCH 6/6] adapted paths --- test/bootstrap.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/bootstrap.php b/test/bootstrap.php index 7678ff3..8f93448 100644 --- a/test/bootstrap.php +++ b/test/bootstrap.php @@ -8,10 +8,12 @@ if ( file_exists( $composer_file ) ) require_once $composer_file; +$src_dir =$base_dir.'/src/'; + //set up autoloader -require_once $base_dir . './src/inc/Autoloader.php'; -$autoloader = new inc\Autoloader( __NAMESPACE__, $base_dir.'./src/' ); +require_once $src_dir . 'inc/Autoloader.php'; +$autoloader = new inc\Autoloader( __NAMESPACE__, $src_dir ); $autoloader->register();