Version Description
- Improving way we handle the replacement of sidebars when using default template
- FireFox support for datetime picker.
- Better ACF4 media uploader support for WYSIWG
Download this release
Release Info
Developer | adbox |
Plugin | WordPress Landing Pages |
Version | 2.4.6 |
Comparing to | |
See all releases |
Code changes from version 2.4.5 to 2.4.6
- assets/css/admin/customizer-edit.css +1 -1
- assets/js/admin/tour/tour.post-list.js +1 -1
- assets/tests/build/php.conf +4 -0
- assets/tests/build/php.load +1 -0
- assets/tests/build/travis-ci-apache +23 -0
- assets/tests/codeception/_bootstrap.php +14 -0
- assets/tests/codeception/_data/dump.sql +1 -0
- assets/tests/codeception/_support/AcceptanceHelper.php +10 -0
- assets/tests/codeception/_support/FunctionalHelper.php +10 -0
- assets/tests/codeception/_support/UnitHelper.php +10 -0
- assets/tests/codeception/acceptance/AcceptanceTester.php +1918 -0
- assets/tests/codeception/acceptance/LoginCept.php +48 -0
- assets/tests/codeception/acceptance/StatisticsCept.php +55 -0
- assets/tests/codeception/acceptance/WelcomeCept.php +7 -0
- assets/tests/codeception/acceptance/_bootstrap.php +2 -0
- assets/tests/codeception/functional/FunctionalTester.php +360 -0
- assets/tests/codeception/functional/_bootstrap.php +2 -0
- assets/tests/codeception/unit/UnitTester.php +300 -0
- assets/tests/codeception/unit/_bootstrap.php +2 -0
- assets/tests/phpunit/bootstrap.php +15 -0
- assets/tests/phpunit/test.activations.php +49 -0
- assets/tests/travis-ci/test.statistics.php +68 -0
- classes/class.click-tracking.php +2 -3
- classes/class.sidebars.php +33 -10
- landing-pages.php +2 -2
- readme.txt +17 -8
- screenshot-1.jpg +0 -0
- screenshot-2.jpg +0 -0
- screenshot-3.jpg +0 -0
- screenshot-4.jpg +0 -0
- shared/classes/class.events.php +60 -12
- shared/classes/class.form.php +21 -1
- shared/classes/class.inbound-api.php +24 -17
- shared/classes/class.lead-fields.php +1 -1
- shared/classes/class.lead-storage.php +58 -47
- shared/classes/class.load-assets.php +218 -0
- shared/classes/class.load-shared.php +1 -1
- shared/classes/class.post-type.wp-lead.php +1 -1
- shared/classes/class.shortcodes.email-template.php +7 -0
- shared/shortcodes/css/shortcodes.css +4 -1
- shared/shortcodes/inbound-shortcodes.php +4 -1
- shared/shortcodes/js/shortcodes.js +22 -2
- shared/shortcodes/shortcodes-fields.php +11 -0
- shared/shortcodes/shortcodes-includes.php +2 -1
- shared/shortcodes/shortcodes/forms.php +36 -58
- templates/simple-solid-lite/config.php +0 -2
- templates/simple-solid-lite/index.php +2 -1
- templates/simple-two-column/config.php +1 -2
assets/css/admin/customizer-edit.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/* moving to shared customizer */
|
2 |
-
#wpadminbar, #edit-slug-box, #post-status-info, #screen-options-link-wrap, #leads-table-container, .misc-pub-section, #minor-publishing, .misc-pub-section, .misc-pub-section.curtime, #delete-action, #convert-header, #lp-tour, #view-post-btn, #launch-visual-editer, #adminmenuwrap, #lp_ab_display_stats_metabox, #lp-thumbnail-sidebar-preview, #landing_page_categorydiv, #postimagediv, #leads-table-container-inside, .updated.below-h2 a, .mceButton.mceButtonEnabled.mce_fullscreen, .mce_strikethrough, .mce_wp_more, #setting-error-tgmpa, #lp_preview_this_template {
|
3 |
display: none !important;
|
4 |
}
|
5 |
html.wp-toolbar {
|
1 |
/* moving to shared customizer */
|
2 |
+
#wpadminbar,.page-title-action, #edit-slug-box, #post-status-info, #screen-options-link-wrap, #leads-table-container, .misc-pub-section, #minor-publishing, .misc-pub-section, .misc-pub-section.curtime, #delete-action, #convert-header, #lp-tour, #view-post-btn, #launch-visual-editer, #adminmenuwrap, #lp_ab_display_stats_metabox, #lp-thumbnail-sidebar-preview, #landing_page_categorydiv, #postimagediv, #leads-table-container-inside, .updated.below-h2 a, .mceButton.mceButtonEnabled.mce_fullscreen, .mce_strikethrough, .mce_wp_more, #setting-error-tgmpa, #lp_preview_this_template {
|
3 |
display: none !important;
|
4 |
}
|
5 |
html.wp-toolbar {
|
assets/js/admin/tour/tour.post-list.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
// Post Edit Screen Tour
|
2 |
jQuery(".thumbnail-lander.column-thumbnail-lander:eq(0)").attr({"data-step": "1", "data-intro": 'This is a quick screenshot of your landing page.<br><br> Click on it to see the live version in a popup window here.<br><br> You can preview your a/b variations directly from this view.'});
|
3 |
jQuery(".post-title.page-title.column-title:eq(0)").attr({"data-step": "2", "data-intro": '<p>This is the admin title of the landing page. This isn\'t visible to visitors</p><p>You can delete, clone, or clears all of the page stats from here.</p><p><strong>Trash:</strong> Deletes this landing page and places it in the trash</p><p><strong>Edit:</strong> Jump to edit screen of this landing page</p><p><strong>Preview:</strong> Pop open preview window</p><p><strong>Clone:</strong> Clones exact copy of landing page. This includes all current variations.</p><p><strong>Clear Stats:</strong> This will clear all stats for each variation. This cannot be undone.</p>'});
|
4 |
-
jQuery(".stats.column-stats:eq(0)").attr({"data-step": "3", "data-intro": '<p>These are the current stats of your landing page variations.</p><p>
|
5 |
jQuery("#impressions").attr({"data-step": "4", "data-intro": '<p>This column shows the total number of page views the landing page has. This include all current A/B testing variations.</p>'});
|
6 |
jQuery("#actions").attr({"data-step": "5", "data-intro": '<p>This column shows the total number of conversions the landing page has. This include all current A/B testing variations.</p>'});
|
7 |
jQuery("#cr").attr({"data-step": "6", "data-intro": '<p>This column shows the total aggregate conversion rate of the landing page. This include all current A/B testing variations.</p>'});
|
1 |
// Post Edit Screen Tour
|
2 |
jQuery(".thumbnail-lander.column-thumbnail-lander:eq(0)").attr({"data-step": "1", "data-intro": 'This is a quick screenshot of your landing page.<br><br> Click on it to see the live version in a popup window here.<br><br> You can preview your a/b variations directly from this view.'});
|
3 |
jQuery(".post-title.page-title.column-title:eq(0)").attr({"data-step": "2", "data-intro": '<p>This is the admin title of the landing page. This isn\'t visible to visitors</p><p>You can delete, clone, or clears all of the page stats from here.</p><p><strong>Trash:</strong> Deletes this landing page and places it in the trash</p><p><strong>Edit:</strong> Jump to edit screen of this landing page</p><p><strong>Preview:</strong> Pop open preview window</p><p><strong>Clone:</strong> Clones exact copy of landing page. This includes all current variations.</p><p><strong>Clear Stats:</strong> This will clear all stats for each variation. This cannot be undone.</p>'});
|
4 |
+
jQuery(".stats.column-stats:eq(0)").attr({"data-step": "3", "data-intro": '<p>These are the current stats of your landing page variations.</p><p>Green boxes mean the variation is winning!</p>'});
|
5 |
jQuery("#impressions").attr({"data-step": "4", "data-intro": '<p>This column shows the total number of page views the landing page has. This include all current A/B testing variations.</p>'});
|
6 |
jQuery("#actions").attr({"data-step": "5", "data-intro": '<p>This column shows the total number of conversions the landing page has. This include all current A/B testing variations.</p>'});
|
7 |
jQuery("#cr").attr({"data-step": "6", "data-intro": '<p>This column shows the total aggregate conversion rate of the landing page. This include all current A/B testing variations.</p>'});
|
assets/tests/build/php.conf
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<IfModule mod_php5.c>
|
2 |
+
AddType application/x-httpd-php .php .phtml .php5
|
3 |
+
AddType application/x-httpd-php-source .phps
|
4 |
+
</IfModule>
|
assets/tests/build/php.load
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
|
assets/tests/build/travis-ci-apache
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<VirtualHost *:80>
|
2 |
+
ServerAdmin tests@inboundnow.com
|
3 |
+
DocumentRoot /var/www/inboundtesting.dev/
|
4 |
+
ServerName inboundtesting.dev
|
5 |
+
ErrorLog ${APACHE_LOG_DIR}/error.log
|
6 |
+
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
7 |
+
|
8 |
+
# Wire up Apache to use Travis CI's php-fpm.
|
9 |
+
<IfModule mod_fastcgi.c>
|
10 |
+
AddHandler php5-fcgi .php
|
11 |
+
Action php5-fcgi /php5-fcgi
|
12 |
+
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
|
13 |
+
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization
|
14 |
+
</IfModule>
|
15 |
+
|
16 |
+
<Directory "/var/www/inboundtesting.dev/">
|
17 |
+
Options FollowSymLinks MultiViews ExecCGI
|
18 |
+
AllowOverride All
|
19 |
+
Order deny,allow
|
20 |
+
Allow from all
|
21 |
+
</Directory>
|
22 |
+
</VirtualHost>
|
23 |
+
|
assets/tests/codeception/_bootstrap.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
/* load wp */
|
5 |
+
require '../../../wp-load.php';
|
6 |
+
require '../../../wp-admin/includes/plugin.php';
|
7 |
+
|
8 |
+
/* load coception addons */
|
9 |
+
require LANDINGPAGES_PATH . 'vendor/lucatume/wp-browser/src/Codeception/Module/WPBrowserMethods.php';
|
10 |
+
require LANDINGPAGES_PATH . 'vendor/lucatume/wp-browser/src/Codeception/Module/WPBrowser.php';
|
11 |
+
|
12 |
+
/* Set current users */
|
13 |
+
wp_set_current_user( 1 );
|
14 |
+
global $wpdb;
|
assets/tests/codeception/_data/dump.sql
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
/* Replace this file with actual dump of your database */
|
assets/tests/codeception/_support/AcceptanceHelper.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Codeception\Module;
|
3 |
+
|
4 |
+
// here you can define custom actions
|
5 |
+
// all public methods declared in helper class will be available in $I
|
6 |
+
|
7 |
+
class AcceptanceHelper extends \Codeception\Module
|
8 |
+
{
|
9 |
+
|
10 |
+
}
|
assets/tests/codeception/_support/FunctionalHelper.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Codeception\Module;
|
3 |
+
|
4 |
+
// here you can define custom actions
|
5 |
+
// all public methods declared in helper class will be available in $I
|
6 |
+
|
7 |
+
class FunctionalHelper extends \Codeception\Module
|
8 |
+
{
|
9 |
+
|
10 |
+
}
|
assets/tests/codeception/_support/UnitHelper.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Codeception\Module;
|
3 |
+
|
4 |
+
// here you can define custom actions
|
5 |
+
// all public methods declared in helper class will be available in $I
|
6 |
+
|
7 |
+
class UnitHelper extends \Codeception\Module
|
8 |
+
{
|
9 |
+
|
10 |
+
}
|
assets/tests/codeception/acceptance/AcceptanceTester.php
ADDED
@@ -0,0 +1,1918 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php //[STAMP] 2d5aa64986f8f94bc0f812d88aa9dee6
|
2 |
+
|
3 |
+
// This class was automatically generated by build task
|
4 |
+
// You should not change it manually as it will be overwritten on next build
|
5 |
+
// @codingStandardsIgnoreFile
|
6 |
+
|
7 |
+
|
8 |
+
use Codeception\Module\PhpBrowser;
|
9 |
+
use Codeception\Module\AcceptanceHelper;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Inherited Methods
|
13 |
+
* @method void wantToTest($text)
|
14 |
+
* @method void wantTo($text)
|
15 |
+
* @method void execute($callable)
|
16 |
+
* @method void expectTo($prediction)
|
17 |
+
* @method void expect($prediction)
|
18 |
+
* @method void amGoingTo($argumentation)
|
19 |
+
* @method void am($role)
|
20 |
+
* @method void lookForwardTo($achieveValue)
|
21 |
+
* @method void comment($description)
|
22 |
+
* @method void haveFriend($name, $actorClass = null)
|
23 |
+
*
|
24 |
+
* @SuppressWarnings(PHPMD)
|
25 |
+
*/
|
26 |
+
class AcceptanceTester extends \Codeception\Actor
|
27 |
+
{
|
28 |
+
|
29 |
+
/**
|
30 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
31 |
+
*
|
32 |
+
* Sets the HTTP header to the passed value - which is used on
|
33 |
+
* subsequent HTTP requests through PhpBrowser.
|
34 |
+
*
|
35 |
+
* Example:
|
36 |
+
* ```php
|
37 |
+
* <?php
|
38 |
+
* $I->setHeader('X-Requested-With', 'Codeception');
|
39 |
+
* $I->amOnPage('test-headers.php');
|
40 |
+
* ?>
|
41 |
+
* ```
|
42 |
+
*
|
43 |
+
* @param string $name the name of the request header
|
44 |
+
* @param string $value the value to set it to for subsequent
|
45 |
+
* requests
|
46 |
+
* @see \Codeception\Module\PhpBrowser::setHeader()
|
47 |
+
*/
|
48 |
+
public function setHeader($name, $value) {
|
49 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('setHeader', func_get_args()));
|
50 |
+
}
|
51 |
+
|
52 |
+
|
53 |
+
/**
|
54 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
55 |
+
*
|
56 |
+
* Deletes the header with the passed name. Subsequent requests
|
57 |
+
* will not have the deleted header in its request.
|
58 |
+
*
|
59 |
+
* Example:
|
60 |
+
* ```php
|
61 |
+
* <?php
|
62 |
+
* $I->setHeader('X-Requested-With', 'Codeception');
|
63 |
+
* $I->amOnPage('test-headers.php');
|
64 |
+
* // ...
|
65 |
+
* $I->deleteHeader('X-Requested-With');
|
66 |
+
* $I->amOnPage('some-other-page.php');
|
67 |
+
* ?>
|
68 |
+
* ```
|
69 |
+
*
|
70 |
+
* @param string $name the name of the header to delete.
|
71 |
+
* @see \Codeception\Module\PhpBrowser::deleteHeader()
|
72 |
+
*/
|
73 |
+
public function deleteHeader($name) {
|
74 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('deleteHeader', func_get_args()));
|
75 |
+
}
|
76 |
+
|
77 |
+
|
78 |
+
/**
|
79 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
80 |
+
*
|
81 |
+
* Authenticates user for HTTP_AUTH
|
82 |
+
*
|
83 |
+
* @param $username
|
84 |
+
* @param $password
|
85 |
+
* @see \Codeception\Module\PhpBrowser::amHttpAuthenticated()
|
86 |
+
*/
|
87 |
+
public function amHttpAuthenticated($username, $password) {
|
88 |
+
return $this->scenario->runStep(new \Codeception\Step\Condition('amHttpAuthenticated', func_get_args()));
|
89 |
+
}
|
90 |
+
|
91 |
+
|
92 |
+
/**
|
93 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
94 |
+
*
|
95 |
+
* Opens the page for the given relative URI.
|
96 |
+
*
|
97 |
+
* ``` php
|
98 |
+
* <?php
|
99 |
+
* // opens front page
|
100 |
+
* $I->amOnPage('/');
|
101 |
+
* // opens /register page
|
102 |
+
* $I->amOnPage('/register');
|
103 |
+
* ?>
|
104 |
+
* ```
|
105 |
+
*
|
106 |
+
* @param $page
|
107 |
+
* @see \Codeception\Module\PhpBrowser::amOnPage()
|
108 |
+
*/
|
109 |
+
public function amOnPage($page) {
|
110 |
+
return $this->scenario->runStep(new \Codeception\Step\Condition('amOnPage', func_get_args()));
|
111 |
+
}
|
112 |
+
|
113 |
+
|
114 |
+
/**
|
115 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
116 |
+
*
|
117 |
+
* Open web page at the given absolute URL and sets its hostname as the base host.
|
118 |
+
*
|
119 |
+
* ``` php
|
120 |
+
* <?php
|
121 |
+
* $I->amOnUrl('http://codeception.com');
|
122 |
+
* $I->amOnPage('/quickstart'); // moves to http://codeception.com/quickstart
|
123 |
+
* ?>
|
124 |
+
* ```
|
125 |
+
* @see \Codeception\Module\PhpBrowser::amOnUrl()
|
126 |
+
*/
|
127 |
+
public function amOnUrl($url) {
|
128 |
+
return $this->scenario->runStep(new \Codeception\Step\Condition('amOnUrl', func_get_args()));
|
129 |
+
}
|
130 |
+
|
131 |
+
|
132 |
+
/**
|
133 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
134 |
+
*
|
135 |
+
* Changes the subdomain for the 'url' configuration parameter.
|
136 |
+
* Does not open a page; use `amOnPage` for that.
|
137 |
+
*
|
138 |
+
* ``` php
|
139 |
+
* <?php
|
140 |
+
* // If config is: 'http://mysite.com'
|
141 |
+
* // or config is: 'http://www.mysite.com'
|
142 |
+
* // or config is: 'http://company.mysite.com'
|
143 |
+
*
|
144 |
+
* $I->amOnSubdomain('user');
|
145 |
+
* $I->amOnPage('/');
|
146 |
+
* // moves to http://user.mysite.com/
|
147 |
+
* ?>
|
148 |
+
* ```
|
149 |
+
*
|
150 |
+
* @param $subdomain
|
151 |
+
*
|
152 |
+
* @return mixed
|
153 |
+
* @see \Codeception\Module\PhpBrowser::amOnSubdomain()
|
154 |
+
*/
|
155 |
+
public function amOnSubdomain($subdomain) {
|
156 |
+
return $this->scenario->runStep(new \Codeception\Step\Condition('amOnSubdomain', func_get_args()));
|
157 |
+
}
|
158 |
+
|
159 |
+
|
160 |
+
/**
|
161 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
162 |
+
*
|
163 |
+
* Low-level API method.
|
164 |
+
* If Codeception commands are not enough, use [Guzzle HTTP Client](http://guzzlephp.org/) methods directly
|
165 |
+
*
|
166 |
+
* Example:
|
167 |
+
*
|
168 |
+
* ``` php
|
169 |
+
* <?php
|
170 |
+
* $I->executeInGuzzle(function (\GuzzleHttp\Client $client) {
|
171 |
+
* $client->get('/get', ['query' => ['foo' => 'bar']]);
|
172 |
+
* });
|
173 |
+
* ?>
|
174 |
+
* ```
|
175 |
+
*
|
176 |
+
* It is not recommended to use this command on a regular basis.
|
177 |
+
* If Codeception lacks important Guzzle Client methods, implement them and submit patches.
|
178 |
+
*
|
179 |
+
* @param callable $function
|
180 |
+
* @see \Codeception\Module\PhpBrowser::executeInGuzzle()
|
181 |
+
*/
|
182 |
+
public function executeInGuzzle($function) {
|
183 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('executeInGuzzle', func_get_args()));
|
184 |
+
}
|
185 |
+
|
186 |
+
|
187 |
+
/**
|
188 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
189 |
+
*
|
190 |
+
* Perform a click on a link or a button, given by a locator.
|
191 |
+
* If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
|
192 |
+
* For buttons, the "value" attribute, "name" attribute, and inner text are searched.
|
193 |
+
* For links, the link text is searched.
|
194 |
+
* For images, the "alt" attribute and inner text of any parent links are searched.
|
195 |
+
*
|
196 |
+
* The second parameter is a context (CSS or XPath locator) to narrow the search.
|
197 |
+
*
|
198 |
+
* Note that if the locator matches a button of type `submit`, the form will be submitted.
|
199 |
+
*
|
200 |
+
* ``` php
|
201 |
+
* <?php
|
202 |
+
* // simple link
|
203 |
+
* $I->click('Logout');
|
204 |
+
* // button of form
|
205 |
+
* $I->click('Submit');
|
206 |
+
* // CSS button
|
207 |
+
* $I->click('#form input[type=submit]');
|
208 |
+
* // XPath
|
209 |
+
* $I->click('//form/*[@type=submit]');
|
210 |
+
* // link in context
|
211 |
+
* $I->click('Logout', '#nav');
|
212 |
+
* // using strict locator
|
213 |
+
* $I->click(['link' => 'Login']);
|
214 |
+
* ?>
|
215 |
+
* ```
|
216 |
+
*
|
217 |
+
* @param $link
|
218 |
+
* @param $context
|
219 |
+
* @see \Codeception\Lib\InnerBrowser::click()
|
220 |
+
*/
|
221 |
+
public function click($link, $context = null) {
|
222 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('click', func_get_args()));
|
223 |
+
}
|
224 |
+
|
225 |
+
|
226 |
+
/**
|
227 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
228 |
+
*
|
229 |
+
* Checks that the current page contains the given string.
|
230 |
+
* Specify a locator as the second parameter to match a specific region.
|
231 |
+
*
|
232 |
+
* ``` php
|
233 |
+
* <?php
|
234 |
+
* $I->see('Logout'); // I can suppose user is logged in
|
235 |
+
* $I->see('Sign Up','h1'); // I can suppose it's a signup page
|
236 |
+
* $I->see('Sign Up','//body/h1'); // with XPath
|
237 |
+
* ?>
|
238 |
+
* ```
|
239 |
+
*
|
240 |
+
* @param $text
|
241 |
+
* @param null $selector
|
242 |
+
* Conditional Assertion: Test won't be stopped on fail
|
243 |
+
* @see \Codeception\Lib\InnerBrowser::see()
|
244 |
+
*/
|
245 |
+
public function canSee($text, $selector = null) {
|
246 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('see', func_get_args()));
|
247 |
+
}
|
248 |
+
/**
|
249 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
250 |
+
*
|
251 |
+
* Checks that the current page contains the given string.
|
252 |
+
* Specify a locator as the second parameter to match a specific region.
|
253 |
+
*
|
254 |
+
* ``` php
|
255 |
+
* <?php
|
256 |
+
* $I->see('Logout'); // I can suppose user is logged in
|
257 |
+
* $I->see('Sign Up','h1'); // I can suppose it's a signup page
|
258 |
+
* $I->see('Sign Up','//body/h1'); // with XPath
|
259 |
+
* ?>
|
260 |
+
* ```
|
261 |
+
*
|
262 |
+
* @param $text
|
263 |
+
* @param null $selector
|
264 |
+
* @see \Codeception\Lib\InnerBrowser::see()
|
265 |
+
*/
|
266 |
+
public function see($text, $selector = null) {
|
267 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('see', func_get_args()));
|
268 |
+
}
|
269 |
+
|
270 |
+
|
271 |
+
/**
|
272 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
273 |
+
*
|
274 |
+
* Checks that the current page doesn't contain the text specified.
|
275 |
+
* Give a locator as the second parameter to match a specific region.
|
276 |
+
*
|
277 |
+
* ```php
|
278 |
+
* <?php
|
279 |
+
* $I->dontSee('Login'); // I can suppose user is already logged in
|
280 |
+
* $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page
|
281 |
+
* $I->dontSee('Sign Up','//body/h1'); // with XPath
|
282 |
+
* ?>
|
283 |
+
* ```
|
284 |
+
*
|
285 |
+
* @param $text
|
286 |
+
* @param null $selector
|
287 |
+
* Conditional Assertion: Test won't be stopped on fail
|
288 |
+
* @see \Codeception\Lib\InnerBrowser::dontSee()
|
289 |
+
*/
|
290 |
+
public function cantSee($text, $selector = null) {
|
291 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args()));
|
292 |
+
}
|
293 |
+
/**
|
294 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
295 |
+
*
|
296 |
+
* Checks that the current page doesn't contain the text specified.
|
297 |
+
* Give a locator as the second parameter to match a specific region.
|
298 |
+
*
|
299 |
+
* ```php
|
300 |
+
* <?php
|
301 |
+
* $I->dontSee('Login'); // I can suppose user is already logged in
|
302 |
+
* $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page
|
303 |
+
* $I->dontSee('Sign Up','//body/h1'); // with XPath
|
304 |
+
* ?>
|
305 |
+
* ```
|
306 |
+
*
|
307 |
+
* @param $text
|
308 |
+
* @param null $selector
|
309 |
+
* @see \Codeception\Lib\InnerBrowser::dontSee()
|
310 |
+
*/
|
311 |
+
public function dontSee($text, $selector = null) {
|
312 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSee', func_get_args()));
|
313 |
+
}
|
314 |
+
|
315 |
+
|
316 |
+
/**
|
317 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
318 |
+
*
|
319 |
+
* Checks that there's a link with the specified text.
|
320 |
+
* Give a full URL as the second parameter to match links with that exact URL.
|
321 |
+
*
|
322 |
+
* ``` php
|
323 |
+
* <?php
|
324 |
+
* $I->seeLink('Logout'); // matches <a href="#">Logout</a>
|
325 |
+
* $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a>
|
326 |
+
* ?>
|
327 |
+
* ```
|
328 |
+
*
|
329 |
+
* @param $text
|
330 |
+
* @param null $url
|
331 |
+
* Conditional Assertion: Test won't be stopped on fail
|
332 |
+
* @see \Codeception\Lib\InnerBrowser::seeLink()
|
333 |
+
*/
|
334 |
+
public function canSeeLink($text, $url = null) {
|
335 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args()));
|
336 |
+
}
|
337 |
+
/**
|
338 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
339 |
+
*
|
340 |
+
* Checks that there's a link with the specified text.
|
341 |
+
* Give a full URL as the second parameter to match links with that exact URL.
|
342 |
+
*
|
343 |
+
* ``` php
|
344 |
+
* <?php
|
345 |
+
* $I->seeLink('Logout'); // matches <a href="#">Logout</a>
|
346 |
+
* $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a>
|
347 |
+
* ?>
|
348 |
+
* ```
|
349 |
+
*
|
350 |
+
* @param $text
|
351 |
+
* @param null $url
|
352 |
+
* @see \Codeception\Lib\InnerBrowser::seeLink()
|
353 |
+
*/
|
354 |
+
public function seeLink($text, $url = null) {
|
355 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeLink', func_get_args()));
|
356 |
+
}
|
357 |
+
|
358 |
+
|
359 |
+
/**
|
360 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
361 |
+
*
|
362 |
+
* Checks that the page doesn't contain a link with the given string.
|
363 |
+
* If the second parameter is given, only links with a matching "href" attribute will be checked.
|
364 |
+
*
|
365 |
+
* ``` php
|
366 |
+
* <?php
|
367 |
+
* $I->dontSeeLink('Logout'); // I suppose user is not logged in
|
368 |
+
* $I->dontSeeLink('Checkout now', '/store/cart.php');
|
369 |
+
* ?>
|
370 |
+
* ```
|
371 |
+
*
|
372 |
+
* @param $text
|
373 |
+
* @param null $url
|
374 |
+
* Conditional Assertion: Test won't be stopped on fail
|
375 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeLink()
|
376 |
+
*/
|
377 |
+
public function cantSeeLink($text, $url = null) {
|
378 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args()));
|
379 |
+
}
|
380 |
+
/**
|
381 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
382 |
+
*
|
383 |
+
* Checks that the page doesn't contain a link with the given string.
|
384 |
+
* If the second parameter is given, only links with a matching "href" attribute will be checked.
|
385 |
+
*
|
386 |
+
* ``` php
|
387 |
+
* <?php
|
388 |
+
* $I->dontSeeLink('Logout'); // I suppose user is not logged in
|
389 |
+
* $I->dontSeeLink('Checkout now', '/store/cart.php');
|
390 |
+
* ?>
|
391 |
+
* ```
|
392 |
+
*
|
393 |
+
* @param $text
|
394 |
+
* @param null $url
|
395 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeLink()
|
396 |
+
*/
|
397 |
+
public function dontSeeLink($text, $url = null) {
|
398 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeLink', func_get_args()));
|
399 |
+
}
|
400 |
+
|
401 |
+
|
402 |
+
/**
|
403 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
404 |
+
*
|
405 |
+
* Checks that current URI contains the given string.
|
406 |
+
*
|
407 |
+
* ``` php
|
408 |
+
* <?php
|
409 |
+
* // to match: /home/dashboard
|
410 |
+
* $I->seeInCurrentUrl('home');
|
411 |
+
* // to match: /users/1
|
412 |
+
* $I->seeInCurrentUrl('/users/');
|
413 |
+
* ?>
|
414 |
+
* ```
|
415 |
+
*
|
416 |
+
* @param $uri
|
417 |
+
* Conditional Assertion: Test won't be stopped on fail
|
418 |
+
* @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl()
|
419 |
+
*/
|
420 |
+
public function canSeeInCurrentUrl($uri) {
|
421 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentUrl', func_get_args()));
|
422 |
+
}
|
423 |
+
/**
|
424 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
425 |
+
*
|
426 |
+
* Checks that current URI contains the given string.
|
427 |
+
*
|
428 |
+
* ``` php
|
429 |
+
* <?php
|
430 |
+
* // to match: /home/dashboard
|
431 |
+
* $I->seeInCurrentUrl('home');
|
432 |
+
* // to match: /users/1
|
433 |
+
* $I->seeInCurrentUrl('/users/');
|
434 |
+
* ?>
|
435 |
+
* ```
|
436 |
+
*
|
437 |
+
* @param $uri
|
438 |
+
* @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl()
|
439 |
+
*/
|
440 |
+
public function seeInCurrentUrl($uri) {
|
441 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInCurrentUrl', func_get_args()));
|
442 |
+
}
|
443 |
+
|
444 |
+
|
445 |
+
/**
|
446 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
447 |
+
*
|
448 |
+
* Checks that the current URI doesn't contain the given string.
|
449 |
+
*
|
450 |
+
* ``` php
|
451 |
+
* <?php
|
452 |
+
* $I->dontSeeInCurrentUrl('/users/');
|
453 |
+
* ?>
|
454 |
+
* ```
|
455 |
+
*
|
456 |
+
* @param $uri
|
457 |
+
* Conditional Assertion: Test won't be stopped on fail
|
458 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl()
|
459 |
+
*/
|
460 |
+
public function cantSeeInCurrentUrl($uri) {
|
461 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInCurrentUrl', func_get_args()));
|
462 |
+
}
|
463 |
+
/**
|
464 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
465 |
+
*
|
466 |
+
* Checks that the current URI doesn't contain the given string.
|
467 |
+
*
|
468 |
+
* ``` php
|
469 |
+
* <?php
|
470 |
+
* $I->dontSeeInCurrentUrl('/users/');
|
471 |
+
* ?>
|
472 |
+
* ```
|
473 |
+
*
|
474 |
+
* @param $uri
|
475 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl()
|
476 |
+
*/
|
477 |
+
public function dontSeeInCurrentUrl($uri) {
|
478 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInCurrentUrl', func_get_args()));
|
479 |
+
}
|
480 |
+
|
481 |
+
|
482 |
+
/**
|
483 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
484 |
+
*
|
485 |
+
* Checks that the current URL is equal to the given string.
|
486 |
+
* Unlike `seeInCurrentUrl`, this only matches the full URL.
|
487 |
+
*
|
488 |
+
* ``` php
|
489 |
+
* <?php
|
490 |
+
* // to match root url
|
491 |
+
* $I->seeCurrentUrlEquals('/');
|
492 |
+
* ?>
|
493 |
+
* ```
|
494 |
+
*
|
495 |
+
* @param $uri
|
496 |
+
* Conditional Assertion: Test won't be stopped on fail
|
497 |
+
* @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals()
|
498 |
+
*/
|
499 |
+
public function canSeeCurrentUrlEquals($uri) {
|
500 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlEquals', func_get_args()));
|
501 |
+
}
|
502 |
+
/**
|
503 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
504 |
+
*
|
505 |
+
* Checks that the current URL is equal to the given string.
|
506 |
+
* Unlike `seeInCurrentUrl`, this only matches the full URL.
|
507 |
+
*
|
508 |
+
* ``` php
|
509 |
+
* <?php
|
510 |
+
* // to match root url
|
511 |
+
* $I->seeCurrentUrlEquals('/');
|
512 |
+
* ?>
|
513 |
+
* ```
|
514 |
+
*
|
515 |
+
* @param $uri
|
516 |
+
* @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals()
|
517 |
+
*/
|
518 |
+
public function seeCurrentUrlEquals($uri) {
|
519 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCurrentUrlEquals', func_get_args()));
|
520 |
+
}
|
521 |
+
|
522 |
+
|
523 |
+
/**
|
524 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
525 |
+
*
|
526 |
+
* Checks that the current URL doesn't equal the given string.
|
527 |
+
* Unlike `dontSeeInCurrentUrl`, this only matches the full URL.
|
528 |
+
*
|
529 |
+
* ``` php
|
530 |
+
* <?php
|
531 |
+
* // current url is not root
|
532 |
+
* $I->dontSeeCurrentUrlEquals('/');
|
533 |
+
* ?>
|
534 |
+
* ```
|
535 |
+
*
|
536 |
+
* @param $uri
|
537 |
+
* Conditional Assertion: Test won't be stopped on fail
|
538 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals()
|
539 |
+
*/
|
540 |
+
public function cantSeeCurrentUrlEquals($uri) {
|
541 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlEquals', func_get_args()));
|
542 |
+
}
|
543 |
+
/**
|
544 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
545 |
+
*
|
546 |
+
* Checks that the current URL doesn't equal the given string.
|
547 |
+
* Unlike `dontSeeInCurrentUrl`, this only matches the full URL.
|
548 |
+
*
|
549 |
+
* ``` php
|
550 |
+
* <?php
|
551 |
+
* // current url is not root
|
552 |
+
* $I->dontSeeCurrentUrlEquals('/');
|
553 |
+
* ?>
|
554 |
+
* ```
|
555 |
+
*
|
556 |
+
* @param $uri
|
557 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals()
|
558 |
+
*/
|
559 |
+
public function dontSeeCurrentUrlEquals($uri) {
|
560 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlEquals', func_get_args()));
|
561 |
+
}
|
562 |
+
|
563 |
+
|
564 |
+
/**
|
565 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
566 |
+
*
|
567 |
+
* Checks that the current URL matches the given regular expression.
|
568 |
+
*
|
569 |
+
* ``` php
|
570 |
+
* <?php
|
571 |
+
* // to match root url
|
572 |
+
* $I->seeCurrentUrlMatches('~$/users/(\d+)~');
|
573 |
+
* ?>
|
574 |
+
* ```
|
575 |
+
*
|
576 |
+
* @param $uri
|
577 |
+
* Conditional Assertion: Test won't be stopped on fail
|
578 |
+
* @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches()
|
579 |
+
*/
|
580 |
+
public function canSeeCurrentUrlMatches($uri) {
|
581 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlMatches', func_get_args()));
|
582 |
+
}
|
583 |
+
/**
|
584 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
585 |
+
*
|
586 |
+
* Checks that the current URL matches the given regular expression.
|
587 |
+
*
|
588 |
+
* ``` php
|
589 |
+
* <?php
|
590 |
+
* // to match root url
|
591 |
+
* $I->seeCurrentUrlMatches('~$/users/(\d+)~');
|
592 |
+
* ?>
|
593 |
+
* ```
|
594 |
+
*
|
595 |
+
* @param $uri
|
596 |
+
* @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches()
|
597 |
+
*/
|
598 |
+
public function seeCurrentUrlMatches($uri) {
|
599 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCurrentUrlMatches', func_get_args()));
|
600 |
+
}
|
601 |
+
|
602 |
+
|
603 |
+
/**
|
604 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
605 |
+
*
|
606 |
+
* Checks that current url doesn't match the given regular expression.
|
607 |
+
*
|
608 |
+
* ``` php
|
609 |
+
* <?php
|
610 |
+
* // to match root url
|
611 |
+
* $I->dontSeeCurrentUrlMatches('~$/users/(\d+)~');
|
612 |
+
* ?>
|
613 |
+
* ```
|
614 |
+
*
|
615 |
+
* @param $uri
|
616 |
+
* Conditional Assertion: Test won't be stopped on fail
|
617 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches()
|
618 |
+
*/
|
619 |
+
public function cantSeeCurrentUrlMatches($uri) {
|
620 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlMatches', func_get_args()));
|
621 |
+
}
|
622 |
+
/**
|
623 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
624 |
+
*
|
625 |
+
* Checks that current url doesn't match the given regular expression.
|
626 |
+
*
|
627 |
+
* ``` php
|
628 |
+
* <?php
|
629 |
+
* // to match root url
|
630 |
+
* $I->dontSeeCurrentUrlMatches('~$/users/(\d+)~');
|
631 |
+
* ?>
|
632 |
+
* ```
|
633 |
+
*
|
634 |
+
* @param $uri
|
635 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches()
|
636 |
+
*/
|
637 |
+
public function dontSeeCurrentUrlMatches($uri) {
|
638 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlMatches', func_get_args()));
|
639 |
+
}
|
640 |
+
|
641 |
+
|
642 |
+
/**
|
643 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
644 |
+
*
|
645 |
+
* Executes the given regular expression against the current URI and returns the first match.
|
646 |
+
* If no parameters are provided, the full URI is returned.
|
647 |
+
*
|
648 |
+
* ``` php
|
649 |
+
* <?php
|
650 |
+
* $user_id = $I->grabFromCurrentUrl('~$/user/(\d+)/~');
|
651 |
+
* $uri = $I->grabFromCurrentUrl();
|
652 |
+
* ?>
|
653 |
+
* ```
|
654 |
+
*
|
655 |
+
* @param null $uri
|
656 |
+
*
|
657 |
+
* @internal param $url
|
658 |
+
* @return mixed
|
659 |
+
* @see \Codeception\Lib\InnerBrowser::grabFromCurrentUrl()
|
660 |
+
*/
|
661 |
+
public function grabFromCurrentUrl($uri = null) {
|
662 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('grabFromCurrentUrl', func_get_args()));
|
663 |
+
}
|
664 |
+
|
665 |
+
|
666 |
+
/**
|
667 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
668 |
+
*
|
669 |
+
* Checks that the specified checkbox is checked.
|
670 |
+
*
|
671 |
+
* ``` php
|
672 |
+
* <?php
|
673 |
+
* $I->seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms
|
674 |
+
* $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form.
|
675 |
+
* $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]');
|
676 |
+
* ?>
|
677 |
+
* ```
|
678 |
+
*
|
679 |
+
* @param $checkbox
|
680 |
+
* Conditional Assertion: Test won't be stopped on fail
|
681 |
+
* @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked()
|
682 |
+
*/
|
683 |
+
public function canSeeCheckboxIsChecked($checkbox) {
|
684 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCheckboxIsChecked', func_get_args()));
|
685 |
+
}
|
686 |
+
/**
|
687 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
688 |
+
*
|
689 |
+
* Checks that the specified checkbox is checked.
|
690 |
+
*
|
691 |
+
* ``` php
|
692 |
+
* <?php
|
693 |
+
* $I->seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms
|
694 |
+
* $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form.
|
695 |
+
* $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]');
|
696 |
+
* ?>
|
697 |
+
* ```
|
698 |
+
*
|
699 |
+
* @param $checkbox
|
700 |
+
* @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked()
|
701 |
+
*/
|
702 |
+
public function seeCheckboxIsChecked($checkbox) {
|
703 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCheckboxIsChecked', func_get_args()));
|
704 |
+
}
|
705 |
+
|
706 |
+
|
707 |
+
/**
|
708 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
709 |
+
*
|
710 |
+
* Check that the specified checkbox is unchecked.
|
711 |
+
*
|
712 |
+
* ``` php
|
713 |
+
* <?php
|
714 |
+
* $I->dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms
|
715 |
+
* $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form.
|
716 |
+
* ?>
|
717 |
+
* ```
|
718 |
+
*
|
719 |
+
* @param $checkbox
|
720 |
+
* Conditional Assertion: Test won't be stopped on fail
|
721 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked()
|
722 |
+
*/
|
723 |
+
public function cantSeeCheckboxIsChecked($checkbox) {
|
724 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCheckboxIsChecked', func_get_args()));
|
725 |
+
}
|
726 |
+
/**
|
727 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
728 |
+
*
|
729 |
+
* Check that the specified checkbox is unchecked.
|
730 |
+
*
|
731 |
+
* ``` php
|
732 |
+
* <?php
|
733 |
+
* $I->dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms
|
734 |
+
* $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form.
|
735 |
+
* ?>
|
736 |
+
* ```
|
737 |
+
*
|
738 |
+
* @param $checkbox
|
739 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked()
|
740 |
+
*/
|
741 |
+
public function dontSeeCheckboxIsChecked($checkbox) {
|
742 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCheckboxIsChecked', func_get_args()));
|
743 |
+
}
|
744 |
+
|
745 |
+
|
746 |
+
/**
|
747 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
748 |
+
*
|
749 |
+
* Checks that the given input field or textarea contains the given value.
|
750 |
+
* For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
|
751 |
+
*
|
752 |
+
* ``` php
|
753 |
+
* <?php
|
754 |
+
* $I->seeInField('Body','Type your comment here');
|
755 |
+
* $I->seeInField('form textarea[name=body]','Type your comment here');
|
756 |
+
* $I->seeInField('form input[type=hidden]','hidden_value');
|
757 |
+
* $I->seeInField('#searchform input','Search');
|
758 |
+
* $I->seeInField('//form/*[@name=search]','Search');
|
759 |
+
* $I->seeInField(['name' => 'search'], 'Search');
|
760 |
+
* ?>
|
761 |
+
* ```
|
762 |
+
*
|
763 |
+
* @param $field
|
764 |
+
* @param $value
|
765 |
+
* Conditional Assertion: Test won't be stopped on fail
|
766 |
+
* @see \Codeception\Lib\InnerBrowser::seeInField()
|
767 |
+
*/
|
768 |
+
public function canSeeInField($field, $value) {
|
769 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInField', func_get_args()));
|
770 |
+
}
|
771 |
+
/**
|
772 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
773 |
+
*
|
774 |
+
* Checks that the given input field or textarea contains the given value.
|
775 |
+
* For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
|
776 |
+
*
|
777 |
+
* ``` php
|
778 |
+
* <?php
|
779 |
+
* $I->seeInField('Body','Type your comment here');
|
780 |
+
* $I->seeInField('form textarea[name=body]','Type your comment here');
|
781 |
+
* $I->seeInField('form input[type=hidden]','hidden_value');
|
782 |
+
* $I->seeInField('#searchform input','Search');
|
783 |
+
* $I->seeInField('//form/*[@name=search]','Search');
|
784 |
+
* $I->seeInField(['name' => 'search'], 'Search');
|
785 |
+
* ?>
|
786 |
+
* ```
|
787 |
+
*
|
788 |
+
* @param $field
|
789 |
+
* @param $value
|
790 |
+
* @see \Codeception\Lib\InnerBrowser::seeInField()
|
791 |
+
*/
|
792 |
+
public function seeInField($field, $value) {
|
793 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInField', func_get_args()));
|
794 |
+
}
|
795 |
+
|
796 |
+
|
797 |
+
/**
|
798 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
799 |
+
*
|
800 |
+
* Checks that an input field or textarea doesn't contain the given value.
|
801 |
+
* For fuzzy locators, the field is matched by label text, CSS and XPath.
|
802 |
+
*
|
803 |
+
* ``` php
|
804 |
+
* <?php
|
805 |
+
* $I->dontSeeInField('Body','Type your comment here');
|
806 |
+
* $I->dontSeeInField('form textarea[name=body]','Type your comment here');
|
807 |
+
* $I->dontSeeInField('form input[type=hidden]','hidden_value');
|
808 |
+
* $I->dontSeeInField('#searchform input','Search');
|
809 |
+
* $I->dontSeeInField('//form/*[@name=search]','Search');
|
810 |
+
* $I->dontSeeInField(['name' => 'search'], 'Search');
|
811 |
+
* ?>
|
812 |
+
* ```
|
813 |
+
*
|
814 |
+
* @param $field
|
815 |
+
* @param $value
|
816 |
+
* Conditional Assertion: Test won't be stopped on fail
|
817 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeInField()
|
818 |
+
*/
|
819 |
+
public function cantSeeInField($field, $value) {
|
820 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInField', func_get_args()));
|
821 |
+
}
|
822 |
+
/**
|
823 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
824 |
+
*
|
825 |
+
* Checks that an input field or textarea doesn't contain the given value.
|
826 |
+
* For fuzzy locators, the field is matched by label text, CSS and XPath.
|
827 |
+
*
|
828 |
+
* ``` php
|
829 |
+
* <?php
|
830 |
+
* $I->dontSeeInField('Body','Type your comment here');
|
831 |
+
* $I->dontSeeInField('form textarea[name=body]','Type your comment here');
|
832 |
+
* $I->dontSeeInField('form input[type=hidden]','hidden_value');
|
833 |
+
* $I->dontSeeInField('#searchform input','Search');
|
834 |
+
* $I->dontSeeInField('//form/*[@name=search]','Search');
|
835 |
+
* $I->dontSeeInField(['name' => 'search'], 'Search');
|
836 |
+
* ?>
|
837 |
+
* ```
|
838 |
+
*
|
839 |
+
* @param $field
|
840 |
+
* @param $value
|
841 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeInField()
|
842 |
+
*/
|
843 |
+
public function dontSeeInField($field, $value) {
|
844 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInField', func_get_args()));
|
845 |
+
}
|
846 |
+
|
847 |
+
|
848 |
+
/**
|
849 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
850 |
+
*
|
851 |
+
* Checks if the array of form parameters (name => value) are set on the form matched with the
|
852 |
+
* passed selector.
|
853 |
+
*
|
854 |
+
* ``` php
|
855 |
+
* <?php
|
856 |
+
* $I->seeInFormFields('form[name=myform]', [
|
857 |
+
* 'input1' => 'value',
|
858 |
+
* 'input2' => 'other value',
|
859 |
+
* ]);
|
860 |
+
* ?>
|
861 |
+
* ```
|
862 |
+
*
|
863 |
+
* For multi-select elements, or to check values of multiple elements with the same name, an
|
864 |
+
* array may be passed:
|
865 |
+
*
|
866 |
+
* ``` php
|
867 |
+
* <?php
|
868 |
+
* $I->seeInFormFields('.form-class', [
|
869 |
+
* 'multiselect' => [
|
870 |
+
* 'value1',
|
871 |
+
* 'value2',
|
872 |
+
* ],
|
873 |
+
* 'checkbox[]' => [
|
874 |
+
* 'a checked value',
|
875 |
+
* 'another checked value',
|
876 |
+
* ],
|
877 |
+
* ]);
|
878 |
+
* ?>
|
879 |
+
* ```
|
880 |
+
*
|
881 |
+
* Additionally, checkbox values can be checked with a boolean.
|
882 |
+
*
|
883 |
+
* ``` php
|
884 |
+
* <?php
|
885 |
+
* $I->seeInFormFields('#form-id', [
|
886 |
+
* 'checkbox1' => true, // passes if checked
|
887 |
+
* 'checkbox2' => false, // passes if unchecked
|
888 |
+
* ]);
|
889 |
+
* ?>
|
890 |
+
* ```
|
891 |
+
*
|
892 |
+
* Pair this with submitForm for quick testing magic.
|
893 |
+
*
|
894 |
+
* ``` php
|
895 |
+
* <?php
|
896 |
+
* $form = [
|
897 |
+
* 'field1' => 'value',
|
898 |
+
* 'field2' => 'another value',
|
899 |
+
* 'checkbox1' => true,
|
900 |
+
* // ...
|
901 |
+
* ];
|
902 |
+
* $I->submitForm('//form[@id=my-form]', $form, 'submitButton');
|
903 |
+
* // $I->amOnPage('/path/to/form-page') may be needed
|
904 |
+
* $I->seeInFormFields('//form[@id=my-form]', $form);
|
905 |
+
* ?>
|
906 |
+
* ```
|
907 |
+
*
|
908 |
+
* @param $formSelector
|
909 |
+
* @param $params
|
910 |
+
* Conditional Assertion: Test won't be stopped on fail
|
911 |
+
* @see \Codeception\Lib\InnerBrowser::seeInFormFields()
|
912 |
+
*/
|
913 |
+
public function canSeeInFormFields($formSelector, $params) {
|
914 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInFormFields', func_get_args()));
|
915 |
+
}
|
916 |
+
/**
|
917 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
918 |
+
*
|
919 |
+
* Checks if the array of form parameters (name => value) are set on the form matched with the
|
920 |
+
* passed selector.
|
921 |
+
*
|
922 |
+
* ``` php
|
923 |
+
* <?php
|
924 |
+
* $I->seeInFormFields('form[name=myform]', [
|
925 |
+
* 'input1' => 'value',
|
926 |
+
* 'input2' => 'other value',
|
927 |
+
* ]);
|
928 |
+
* ?>
|
929 |
+
* ```
|
930 |
+
*
|
931 |
+
* For multi-select elements, or to check values of multiple elements with the same name, an
|
932 |
+
* array may be passed:
|
933 |
+
*
|
934 |
+
* ``` php
|
935 |
+
* <?php
|
936 |
+
* $I->seeInFormFields('.form-class', [
|
937 |
+
* 'multiselect' => [
|
938 |
+
* 'value1',
|
939 |
+
* 'value2',
|
940 |
+
* ],
|
941 |
+
* 'checkbox[]' => [
|
942 |
+
* 'a checked value',
|
943 |
+
* 'another checked value',
|
944 |
+
* ],
|
945 |
+
* ]);
|
946 |
+
* ?>
|
947 |
+
* ```
|
948 |
+
*
|
949 |
+
* Additionally, checkbox values can be checked with a boolean.
|
950 |
+
*
|
951 |
+
* ``` php
|
952 |
+
* <?php
|
953 |
+
* $I->seeInFormFields('#form-id', [
|
954 |
+
* 'checkbox1' => true, // passes if checked
|
955 |
+
* 'checkbox2' => false, // passes if unchecked
|
956 |
+
* ]);
|
957 |
+
* ?>
|
958 |
+
* ```
|
959 |
+
*
|
960 |
+
* Pair this with submitForm for quick testing magic.
|
961 |
+
*
|
962 |
+
* ``` php
|
963 |
+
* <?php
|
964 |
+
* $form = [
|
965 |
+
* 'field1' => 'value',
|
966 |
+
* 'field2' => 'another value',
|
967 |
+
* 'checkbox1' => true,
|
968 |
+
* // ...
|
969 |
+
* ];
|
970 |
+
* $I->submitForm('//form[@id=my-form]', $form, 'submitButton');
|
971 |
+
* // $I->amOnPage('/path/to/form-page') may be needed
|
972 |
+
* $I->seeInFormFields('//form[@id=my-form]', $form);
|
973 |
+
* ?>
|
974 |
+
* ```
|
975 |
+
*
|
976 |
+
* @param $formSelector
|
977 |
+
* @param $params
|
978 |
+
* @see \Codeception\Lib\InnerBrowser::seeInFormFields()
|
979 |
+
*/
|
980 |
+
public function seeInFormFields($formSelector, $params) {
|
981 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInFormFields', func_get_args()));
|
982 |
+
}
|
983 |
+
|
984 |
+
|
985 |
+
/**
|
986 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
987 |
+
*
|
988 |
+
* Checks if the array of form parameters (name => value) are not set on the form matched with
|
989 |
+
* the passed selector.
|
990 |
+
*
|
991 |
+
* ``` php
|
992 |
+
* <?php
|
993 |
+
* $I->dontSeeInFormFields('form[name=myform]', [
|
994 |
+
* 'input1' => 'non-existent value',
|
995 |
+
* 'input2' => 'other non-existent value',
|
996 |
+
* ]);
|
997 |
+
* ?>
|
998 |
+
* ```
|
999 |
+
*
|
1000 |
+
* To check that an element hasn't been assigned any one of many values, an array can be passed
|
1001 |
+
* as the value:
|
1002 |
+
*
|
1003 |
+
* ``` php
|
1004 |
+
* <?php
|
1005 |
+
* $I->dontSeeInFormFields('.form-class', [
|
1006 |
+
* 'fieldName' => [
|
1007 |
+
* 'This value shouldn\'t be set',
|
1008 |
+
* 'And this value shouldn\'t be set',
|
1009 |
+
* ],
|
1010 |
+
* ]);
|
1011 |
+
* ?>
|
1012 |
+
* ```
|
1013 |
+
*
|
1014 |
+
* Additionally, checkbox values can be checked with a boolean.
|
1015 |
+
*
|
1016 |
+
* ``` php
|
1017 |
+
* <?php
|
1018 |
+
* $I->dontSeeInFormFields('#form-id', [
|
1019 |
+
* 'checkbox1' => true, // fails if checked
|
1020 |
+
* 'checkbox2' => false, // fails if unchecked
|
1021 |
+
* ]);
|
1022 |
+
* ?>
|
1023 |
+
* ```
|
1024 |
+
*
|
1025 |
+
* @param $formSelector
|
1026 |
+
* @param $params
|
1027 |
+
* Conditional Assertion: Test won't be stopped on fail
|
1028 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields()
|
1029 |
+
*/
|
1030 |
+
public function cantSeeInFormFields($formSelector, $params) {
|
1031 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInFormFields', func_get_args()));
|
1032 |
+
}
|
1033 |
+
/**
|
1034 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1035 |
+
*
|
1036 |
+
* Checks if the array of form parameters (name => value) are not set on the form matched with
|
1037 |
+
* the passed selector.
|
1038 |
+
*
|
1039 |
+
* ``` php
|
1040 |
+
* <?php
|
1041 |
+
* $I->dontSeeInFormFields('form[name=myform]', [
|
1042 |
+
* 'input1' => 'non-existent value',
|
1043 |
+
* 'input2' => 'other non-existent value',
|
1044 |
+
* ]);
|
1045 |
+
* ?>
|
1046 |
+
* ```
|
1047 |
+
*
|
1048 |
+
* To check that an element hasn't been assigned any one of many values, an array can be passed
|
1049 |
+
* as the value:
|
1050 |
+
*
|
1051 |
+
* ``` php
|
1052 |
+
* <?php
|
1053 |
+
* $I->dontSeeInFormFields('.form-class', [
|
1054 |
+
* 'fieldName' => [
|
1055 |
+
* 'This value shouldn\'t be set',
|
1056 |
+
* 'And this value shouldn\'t be set',
|
1057 |
+
* ],
|
1058 |
+
* ]);
|
1059 |
+
* ?>
|
1060 |
+
* ```
|
1061 |
+
*
|
1062 |
+
* Additionally, checkbox values can be checked with a boolean.
|
1063 |
+
*
|
1064 |
+
* ``` php
|
1065 |
+
* <?php
|
1066 |
+
* $I->dontSeeInFormFields('#form-id', [
|
1067 |
+
* 'checkbox1' => true, // fails if checked
|
1068 |
+
* 'checkbox2' => false, // fails if unchecked
|
1069 |
+
* ]);
|
1070 |
+
* ?>
|
1071 |
+
* ```
|
1072 |
+
*
|
1073 |
+
* @param $formSelector
|
1074 |
+
* @param $params
|
1075 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields()
|
1076 |
+
*/
|
1077 |
+
public function dontSeeInFormFields($formSelector, $params) {
|
1078 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInFormFields', func_get_args()));
|
1079 |
+
}
|
1080 |
+
|
1081 |
+
|
1082 |
+
/**
|
1083 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1084 |
+
*
|
1085 |
+
* Submits the given form on the page, optionally with the given form values.
|
1086 |
+
* Give the form fields values as an array.
|
1087 |
+
*
|
1088 |
+
* Skipped fields will be filled by their values from the page.
|
1089 |
+
* You don't need to click the 'Submit' button afterwards.
|
1090 |
+
* This command itself triggers the request to form's action.
|
1091 |
+
*
|
1092 |
+
* You can optionally specify what button's value to include
|
1093 |
+
* in the request with the last parameter as an alternative to
|
1094 |
+
* explicitly setting its value in the second parameter, as
|
1095 |
+
* button values are not otherwise included in the request.
|
1096 |
+
*
|
1097 |
+
* Examples:
|
1098 |
+
*
|
1099 |
+
* ``` php
|
1100 |
+
* <?php
|
1101 |
+
* $I->submitForm('#login', array('login' => 'davert', 'password' => '123456'));
|
1102 |
+
* // or
|
1103 |
+
* $I->submitForm('#login', array('login' => 'davert', 'password' => '123456'), 'submitButtonName');
|
1104 |
+
*
|
1105 |
+
* ```
|
1106 |
+
*
|
1107 |
+
* For example, given this sample "Sign Up" form:
|
1108 |
+
*
|
1109 |
+
* ``` html
|
1110 |
+
* <form action="/sign_up">
|
1111 |
+
* Login: <input type="text" name="user[login]" /><br/>
|
1112 |
+
* Password: <input type="password" name="user[password]" /><br/>
|
1113 |
+
* Do you agree to out terms? <input type="checkbox" name="user[agree]" /><br/>
|
1114 |
+
* Select pricing plan <select name="plan"><option value="1">Free</option><option value="2" selected="selected">Paid</option></select>
|
1115 |
+
* <input type="submit" name="submitButton" value="Submit" />
|
1116 |
+
* </form>
|
1117 |
+
* ```
|
1118 |
+
*
|
1119 |
+
* You could write the following to submit it:
|
1120 |
+
*
|
1121 |
+
* ``` php
|
1122 |
+
* <?php
|
1123 |
+
* $I->submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true)), 'submitButton');
|
1124 |
+
*
|
1125 |
+
* ```
|
1126 |
+
* Note that "2" will be the submitted value for the "plan" field, as it is the selected option.
|
1127 |
+
*
|
1128 |
+
* You can also emulate a JavaScript submission by not specifying any buttons in the third parameter to submitForm.
|
1129 |
+
*
|
1130 |
+
* ```php
|
1131 |
+
* <?php
|
1132 |
+
* $I->submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true)));
|
1133 |
+
*
|
1134 |
+
* ```
|
1135 |
+
*
|
1136 |
+
* Pair this with seeInFormFields for quick testing magic.
|
1137 |
+
*
|
1138 |
+
* ``` php
|
1139 |
+
* <?php
|
1140 |
+
* $form = [
|
1141 |
+
* 'field1' => 'value',
|
1142 |
+
* 'field2' => 'another value',
|
1143 |
+
* 'checkbox1' => true,
|
1144 |
+
* // ...
|
1145 |
+
* ];
|
1146 |
+
* $I->submitForm('//form[@id=my-form]', $form, 'submitButton');
|
1147 |
+
* // $I->amOnPage('/path/to/form-page') may be needed
|
1148 |
+
* $I->seeInFormFields('//form[@id=my-form]', $form);
|
1149 |
+
* ?>
|
1150 |
+
* ```
|
1151 |
+
*
|
1152 |
+
* Parameter values can be set to arrays for multiple input fields
|
1153 |
+
* of the same name, or multi-select combo boxes. For checkboxes,
|
1154 |
+
* either the string value can be used, or boolean values which will
|
1155 |
+
* be replaced by the checkbox's value in the DOM.
|
1156 |
+
*
|
1157 |
+
* ``` php
|
1158 |
+
* <?php
|
1159 |
+
* $I->submitForm('#my-form', [
|
1160 |
+
* 'field1' => 'value',
|
1161 |
+
* 'checkbox' => [
|
1162 |
+
* 'value of first checkbox',
|
1163 |
+
* 'value of second checkbox,
|
1164 |
+
* ],
|
1165 |
+
* 'otherCheckboxes' => [
|
1166 |
+
* true,
|
1167 |
+
* false,
|
1168 |
+
* false
|
1169 |
+
* ],
|
1170 |
+
* 'multiselect' => [
|
1171 |
+
* 'first option value',
|
1172 |
+
* 'second option value'
|
1173 |
+
* ]
|
1174 |
+
* ]);
|
1175 |
+
* ?>
|
1176 |
+
* ```
|
1177 |
+
*
|
1178 |
+
* Mixing string and boolean values for a checkbox's value is not
|
1179 |
+
* supported and may produce unexpected results.
|
1180 |
+
*
|
1181 |
+
* @param $selector
|
1182 |
+
* @param $params
|
1183 |
+
* @param $button
|
1184 |
+
* @see \Codeception\Lib\InnerBrowser::submitForm()
|
1185 |
+
*/
|
1186 |
+
public function submitForm($selector, $params, $button = null) {
|
1187 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('submitForm', func_get_args()));
|
1188 |
+
}
|
1189 |
+
|
1190 |
+
|
1191 |
+
/**
|
1192 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1193 |
+
*
|
1194 |
+
* Fills a text field or textarea with the given string.
|
1195 |
+
*
|
1196 |
+
* ``` php
|
1197 |
+
* <?php
|
1198 |
+
* $I->fillField("//input[@type='text']", "Hello World!");
|
1199 |
+
* $I->fillField(['name' => 'email'], 'jon@mail.com');
|
1200 |
+
* ?>
|
1201 |
+
* ```
|
1202 |
+
*
|
1203 |
+
* @param $field
|
1204 |
+
* @param $value
|
1205 |
+
* @see \Codeception\Lib\InnerBrowser::fillField()
|
1206 |
+
*/
|
1207 |
+
public function fillField($field, $value) {
|
1208 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('fillField', func_get_args()));
|
1209 |
+
}
|
1210 |
+
|
1211 |
+
|
1212 |
+
/**
|
1213 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1214 |
+
*
|
1215 |
+
* Selects an option in a select tag or in radio button group.
|
1216 |
+
*
|
1217 |
+
* ``` php
|
1218 |
+
* <?php
|
1219 |
+
* $I->selectOption('form select[name=account]', 'Premium');
|
1220 |
+
* $I->selectOption('form input[name=payment]', 'Monthly');
|
1221 |
+
* $I->selectOption('//form/select[@name=account]', 'Monthly');
|
1222 |
+
* ?>
|
1223 |
+
* ```
|
1224 |
+
*
|
1225 |
+
* Provide an array for the second argument to select multiple options:
|
1226 |
+
*
|
1227 |
+
* ``` php
|
1228 |
+
* <?php
|
1229 |
+
* $I->selectOption('Which OS do you use?', array('Windows','Linux'));
|
1230 |
+
* ?>
|
1231 |
+
* ```
|
1232 |
+
*
|
1233 |
+
* @param $select
|
1234 |
+
* @param $option
|
1235 |
+
* @see \Codeception\Lib\InnerBrowser::selectOption()
|
1236 |
+
*/
|
1237 |
+
public function selectOption($select, $option) {
|
1238 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('selectOption', func_get_args()));
|
1239 |
+
}
|
1240 |
+
|
1241 |
+
|
1242 |
+
/**
|
1243 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1244 |
+
*
|
1245 |
+
* Ticks a checkbox. For radio buttons, use the `selectOption` method instead.
|
1246 |
+
*
|
1247 |
+
* ``` php
|
1248 |
+
* <?php
|
1249 |
+
* $I->checkOption('#agree');
|
1250 |
+
* ?>
|
1251 |
+
* ```
|
1252 |
+
*
|
1253 |
+
* @param $option
|
1254 |
+
* @see \Codeception\Lib\InnerBrowser::checkOption()
|
1255 |
+
*/
|
1256 |
+
public function checkOption($option) {
|
1257 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('checkOption', func_get_args()));
|
1258 |
+
}
|
1259 |
+
|
1260 |
+
|
1261 |
+
/**
|
1262 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1263 |
+
*
|
1264 |
+
* Unticks a checkbox.
|
1265 |
+
*
|
1266 |
+
* ``` php
|
1267 |
+
* <?php
|
1268 |
+
* $I->uncheckOption('#notify');
|
1269 |
+
* ?>
|
1270 |
+
* ```
|
1271 |
+
*
|
1272 |
+
* @param $option
|
1273 |
+
* @see \Codeception\Lib\InnerBrowser::uncheckOption()
|
1274 |
+
*/
|
1275 |
+
public function uncheckOption($option) {
|
1276 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('uncheckOption', func_get_args()));
|
1277 |
+
}
|
1278 |
+
|
1279 |
+
|
1280 |
+
/**
|
1281 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1282 |
+
*
|
1283 |
+
* Attaches a file relative to the Codeception data directory to the given file upload field.
|
1284 |
+
*
|
1285 |
+
* ``` php
|
1286 |
+
* <?php
|
1287 |
+
* // file is stored in 'tests/_data/prices.xls'
|
1288 |
+
* $I->attachFile('input[@type="file"]', 'prices.xls');
|
1289 |
+
* ?>
|
1290 |
+
* ```
|
1291 |
+
*
|
1292 |
+
* @param $field
|
1293 |
+
* @param $filename
|
1294 |
+
* @see \Codeception\Lib\InnerBrowser::attachFile()
|
1295 |
+
*/
|
1296 |
+
public function attachFile($field, $filename) {
|
1297 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('attachFile', func_get_args()));
|
1298 |
+
}
|
1299 |
+
|
1300 |
+
|
1301 |
+
/**
|
1302 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1303 |
+
*
|
1304 |
+
* If your page triggers an ajax request, you can perform it manually.
|
1305 |
+
* This action sends a GET ajax request with specified params.
|
1306 |
+
*
|
1307 |
+
* See ->sendAjaxPostRequest for examples.
|
1308 |
+
*
|
1309 |
+
* @param $uri
|
1310 |
+
* @param $params
|
1311 |
+
* @see \Codeception\Lib\InnerBrowser::sendAjaxGetRequest()
|
1312 |
+
*/
|
1313 |
+
public function sendAjaxGetRequest($uri, $params = null) {
|
1314 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('sendAjaxGetRequest', func_get_args()));
|
1315 |
+
}
|
1316 |
+
|
1317 |
+
|
1318 |
+
/**
|
1319 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1320 |
+
*
|
1321 |
+
* If your page triggers an ajax request, you can perform it manually.
|
1322 |
+
* This action sends a POST ajax request with specified params.
|
1323 |
+
* Additional params can be passed as array.
|
1324 |
+
*
|
1325 |
+
* Example:
|
1326 |
+
*
|
1327 |
+
* Imagine that by clicking checkbox you trigger ajax request which updates user settings.
|
1328 |
+
* We emulate that click by running this ajax request manually.
|
1329 |
+
*
|
1330 |
+
* ``` php
|
1331 |
+
* <?php
|
1332 |
+
* $I->sendAjaxPostRequest('/updateSettings', array('notifications' => true)); // POST
|
1333 |
+
* $I->sendAjaxGetRequest('/updateSettings', array('notifications' => true)); // GET
|
1334 |
+
*
|
1335 |
+
* ```
|
1336 |
+
*
|
1337 |
+
* @param $uri
|
1338 |
+
* @param $params
|
1339 |
+
* @see \Codeception\Lib\InnerBrowser::sendAjaxPostRequest()
|
1340 |
+
*/
|
1341 |
+
public function sendAjaxPostRequest($uri, $params = null) {
|
1342 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('sendAjaxPostRequest', func_get_args()));
|
1343 |
+
}
|
1344 |
+
|
1345 |
+
|
1346 |
+
/**
|
1347 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1348 |
+
*
|
1349 |
+
* If your page triggers an ajax request, you can perform it manually.
|
1350 |
+
* This action sends an ajax request with specified method and params.
|
1351 |
+
*
|
1352 |
+
* Example:
|
1353 |
+
*
|
1354 |
+
* You need to perform an ajax request specifying the HTTP method.
|
1355 |
+
*
|
1356 |
+
* ``` php
|
1357 |
+
* <?php
|
1358 |
+
* $I->sendAjaxRequest('PUT', '/posts/7', array('title' => 'new title'));
|
1359 |
+
*
|
1360 |
+
* ```
|
1361 |
+
*
|
1362 |
+
* @param $method
|
1363 |
+
* @param $uri
|
1364 |
+
* @param $params
|
1365 |
+
* @see \Codeception\Lib\InnerBrowser::sendAjaxRequest()
|
1366 |
+
*/
|
1367 |
+
public function sendAjaxRequest($method, $uri, $params = null) {
|
1368 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('sendAjaxRequest', func_get_args()));
|
1369 |
+
}
|
1370 |
+
|
1371 |
+
|
1372 |
+
/**
|
1373 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1374 |
+
*
|
1375 |
+
* Finds and returns the text contents of the given element.
|
1376 |
+
* If a fuzzy locator is used, the element is found using CSS, XPath, and by matching the full page source by regular expression.
|
1377 |
+
*
|
1378 |
+
* ``` php
|
1379 |
+
* <?php
|
1380 |
+
* $heading = $I->grabTextFrom('h1');
|
1381 |
+
* $heading = $I->grabTextFrom('descendant-or-self::h1');
|
1382 |
+
* $value = $I->grabTextFrom('~<input value=(.*?)]~sgi'); // match with a regex
|
1383 |
+
* ?>
|
1384 |
+
* ```
|
1385 |
+
*
|
1386 |
+
* @param $cssOrXPathOrRegex
|
1387 |
+
*
|
1388 |
+
* @return mixed
|
1389 |
+
* @see \Codeception\Lib\InnerBrowser::grabTextFrom()
|
1390 |
+
*/
|
1391 |
+
public function grabTextFrom($cssOrXPathOrRegex) {
|
1392 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('grabTextFrom', func_get_args()));
|
1393 |
+
}
|
1394 |
+
|
1395 |
+
|
1396 |
+
/**
|
1397 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1398 |
+
*
|
1399 |
+
* Grabs the value of the given attribute value from the given element.
|
1400 |
+
* Fails if element is not found.
|
1401 |
+
*
|
1402 |
+
* ``` php
|
1403 |
+
* <?php
|
1404 |
+
* $I->grabAttributeFrom('#tooltip', 'title');
|
1405 |
+
* ?>
|
1406 |
+
* ```
|
1407 |
+
*
|
1408 |
+
*
|
1409 |
+
* @param $cssOrXpath
|
1410 |
+
* @param $attribute
|
1411 |
+
* @internal param $element
|
1412 |
+
* @return mixed
|
1413 |
+
* @see \Codeception\Lib\InnerBrowser::grabAttributeFrom()
|
1414 |
+
*/
|
1415 |
+
public function grabAttributeFrom($cssOrXpath, $attribute) {
|
1416 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('grabAttributeFrom', func_get_args()));
|
1417 |
+
}
|
1418 |
+
|
1419 |
+
|
1420 |
+
/**
|
1421 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1422 |
+
*
|
1423 |
+
* @param $field
|
1424 |
+
*
|
1425 |
+
* @return array|mixed|null|string
|
1426 |
+
* @see \Codeception\Lib\InnerBrowser::grabValueFrom()
|
1427 |
+
*/
|
1428 |
+
public function grabValueFrom($field) {
|
1429 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('grabValueFrom', func_get_args()));
|
1430 |
+
}
|
1431 |
+
|
1432 |
+
|
1433 |
+
/**
|
1434 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1435 |
+
*
|
1436 |
+
* Sets a cookie with the given name and value.
|
1437 |
+
* You can set additional cookie params like `domain`, `path`, `expire`, `secure` in array passed as last argument.
|
1438 |
+
*
|
1439 |
+
* ``` php
|
1440 |
+
* <?php
|
1441 |
+
* $I->setCookie('PHPSESSID', 'el4ukv0kqbvoirg7nkp4dncpk3');
|
1442 |
+
* ?>
|
1443 |
+
* ```
|
1444 |
+
*
|
1445 |
+
* @param $name
|
1446 |
+
* @param $val
|
1447 |
+
* @param array $params
|
1448 |
+
* @internal param $cookie
|
1449 |
+
* @internal param $value
|
1450 |
+
*
|
1451 |
+
* @return mixed
|
1452 |
+
* @see \Codeception\Lib\InnerBrowser::setCookie()
|
1453 |
+
*/
|
1454 |
+
public function setCookie($name, $val, $params = null) {
|
1455 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('setCookie', func_get_args()));
|
1456 |
+
}
|
1457 |
+
|
1458 |
+
|
1459 |
+
/**
|
1460 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1461 |
+
*
|
1462 |
+
* Grabs a cookie value.
|
1463 |
+
* You can set additional cookie params like `domain`, `path` in array passed as last argument.
|
1464 |
+
*
|
1465 |
+
* @param $cookie
|
1466 |
+
*
|
1467 |
+
* @param array $params
|
1468 |
+
* @return mixed
|
1469 |
+
* @see \Codeception\Lib\InnerBrowser::grabCookie()
|
1470 |
+
*/
|
1471 |
+
public function grabCookie($name, $params = null) {
|
1472 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('grabCookie', func_get_args()));
|
1473 |
+
}
|
1474 |
+
|
1475 |
+
|
1476 |
+
/**
|
1477 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1478 |
+
*
|
1479 |
+
* Checks that a cookie with the given name is set.
|
1480 |
+
* You can set additional cookie params like `domain`, `path` as array passed in last argument.
|
1481 |
+
*
|
1482 |
+
* ``` php
|
1483 |
+
* <?php
|
1484 |
+
* $I->seeCookie('PHPSESSID');
|
1485 |
+
* ?>
|
1486 |
+
* ```
|
1487 |
+
*
|
1488 |
+
* @param $cookie
|
1489 |
+
* @param array $params
|
1490 |
+
* @return mixed
|
1491 |
+
* Conditional Assertion: Test won't be stopped on fail
|
1492 |
+
* @see \Codeception\Lib\InnerBrowser::seeCookie()
|
1493 |
+
*/
|
1494 |
+
public function canSeeCookie($name, $params = null) {
|
1495 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args()));
|
1496 |
+
}
|
1497 |
+
/**
|
1498 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1499 |
+
*
|
1500 |
+
* Checks that a cookie with the given name is set.
|
1501 |
+
* You can set additional cookie params like `domain`, `path` as array passed in last argument.
|
1502 |
+
*
|
1503 |
+
* ``` php
|
1504 |
+
* <?php
|
1505 |
+
* $I->seeCookie('PHPSESSID');
|
1506 |
+
* ?>
|
1507 |
+
* ```
|
1508 |
+
*
|
1509 |
+
* @param $cookie
|
1510 |
+
* @param array $params
|
1511 |
+
* @return mixed
|
1512 |
+
* @see \Codeception\Lib\InnerBrowser::seeCookie()
|
1513 |
+
*/
|
1514 |
+
public function seeCookie($name, $params = null) {
|
1515 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args()));
|
1516 |
+
}
|
1517 |
+
|
1518 |
+
|
1519 |
+
/**
|
1520 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1521 |
+
*
|
1522 |
+
* Checks that there isn't a cookie with the given name.
|
1523 |
+
* You can set additional cookie params like `domain`, `path` as array passed in last argument.
|
1524 |
+
*
|
1525 |
+
* @param $cookie
|
1526 |
+
*
|
1527 |
+
* @param array $params
|
1528 |
+
* @return mixed
|
1529 |
+
* Conditional Assertion: Test won't be stopped on fail
|
1530 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeCookie()
|
1531 |
+
*/
|
1532 |
+
public function cantSeeCookie($name, $params = null) {
|
1533 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args()));
|
1534 |
+
}
|
1535 |
+
/**
|
1536 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1537 |
+
*
|
1538 |
+
* Checks that there isn't a cookie with the given name.
|
1539 |
+
* You can set additional cookie params like `domain`, `path` as array passed in last argument.
|
1540 |
+
*
|
1541 |
+
* @param $cookie
|
1542 |
+
*
|
1543 |
+
* @param array $params
|
1544 |
+
* @return mixed
|
1545 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeCookie()
|
1546 |
+
*/
|
1547 |
+
public function dontSeeCookie($name, $params = null) {
|
1548 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCookie', func_get_args()));
|
1549 |
+
}
|
1550 |
+
|
1551 |
+
|
1552 |
+
/**
|
1553 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1554 |
+
*
|
1555 |
+
* Unsets cookie with the given name.
|
1556 |
+
* You can set additional cookie params like `domain`, `path` in array passed as last argument.
|
1557 |
+
*
|
1558 |
+
* @param $cookie
|
1559 |
+
*
|
1560 |
+
* @param array $params
|
1561 |
+
* @return mixed
|
1562 |
+
* @see \Codeception\Lib\InnerBrowser::resetCookie()
|
1563 |
+
*/
|
1564 |
+
public function resetCookie($name, $params = null) {
|
1565 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('resetCookie', func_get_args()));
|
1566 |
+
}
|
1567 |
+
|
1568 |
+
|
1569 |
+
/**
|
1570 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1571 |
+
*
|
1572 |
+
* Checks that the given element exists on the page and is visible.
|
1573 |
+
* You can also specify expected attributes of this element.
|
1574 |
+
*
|
1575 |
+
* ``` php
|
1576 |
+
* <?php
|
1577 |
+
* $I->seeElement('.error');
|
1578 |
+
* $I->seeElement('//form/input[1]');
|
1579 |
+
* $I->seeElement('input', ['name' => 'login']);
|
1580 |
+
* $I->seeElement('input', ['value' => '123456']);
|
1581 |
+
*
|
1582 |
+
* // strict locator in first arg, attributes in second
|
1583 |
+
* $I->seeElement(['css' => 'form input'], ['name' => 'login']);
|
1584 |
+
* ?>
|
1585 |
+
* ```
|
1586 |
+
*
|
1587 |
+
* @param $selector
|
1588 |
+
* @param array $attributes
|
1589 |
+
* @return
|
1590 |
+
* Conditional Assertion: Test won't be stopped on fail
|
1591 |
+
* @see \Codeception\Lib\InnerBrowser::seeElement()
|
1592 |
+
*/
|
1593 |
+
public function canSeeElement($selector, $attributes = null) {
|
1594 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args()));
|
1595 |
+
}
|
1596 |
+
/**
|
1597 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1598 |
+
*
|
1599 |
+
* Checks that the given element exists on the page and is visible.
|
1600 |
+
* You can also specify expected attributes of this element.
|
1601 |
+
*
|
1602 |
+
* ``` php
|
1603 |
+
* <?php
|
1604 |
+
* $I->seeElement('.error');
|
1605 |
+
* $I->seeElement('//form/input[1]');
|
1606 |
+
* $I->seeElement('input', ['name' => 'login']);
|
1607 |
+
* $I->seeElement('input', ['value' => '123456']);
|
1608 |
+
*
|
1609 |
+
* // strict locator in first arg, attributes in second
|
1610 |
+
* $I->seeElement(['css' => 'form input'], ['name' => 'login']);
|
1611 |
+
* ?>
|
1612 |
+
* ```
|
1613 |
+
*
|
1614 |
+
* @param $selector
|
1615 |
+
* @param array $attributes
|
1616 |
+
* @return
|
1617 |
+
* @see \Codeception\Lib\InnerBrowser::seeElement()
|
1618 |
+
*/
|
1619 |
+
public function seeElement($selector, $attributes = null) {
|
1620 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args()));
|
1621 |
+
}
|
1622 |
+
|
1623 |
+
|
1624 |
+
/**
|
1625 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1626 |
+
*
|
1627 |
+
* Checks that the given element is invisible or not present on the page.
|
1628 |
+
* You can also specify expected attributes of this element.
|
1629 |
+
*
|
1630 |
+
* ``` php
|
1631 |
+
* <?php
|
1632 |
+
* $I->dontSeeElement('.error');
|
1633 |
+
* $I->dontSeeElement('//form/input[1]');
|
1634 |
+
* $I->dontSeeElement('input', ['name' => 'login']);
|
1635 |
+
* $I->dontSeeElement('input', ['value' => '123456']);
|
1636 |
+
* ?>
|
1637 |
+
* ```
|
1638 |
+
*
|
1639 |
+
* @param $selector
|
1640 |
+
* @param array $attributes
|
1641 |
+
* Conditional Assertion: Test won't be stopped on fail
|
1642 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeElement()
|
1643 |
+
*/
|
1644 |
+
public function cantSeeElement($selector, $attributes = null) {
|
1645 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args()));
|
1646 |
+
}
|
1647 |
+
/**
|
1648 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1649 |
+
*
|
1650 |
+
* Checks that the given element is invisible or not present on the page.
|
1651 |
+
* You can also specify expected attributes of this element.
|
1652 |
+
*
|
1653 |
+
* ``` php
|
1654 |
+
* <?php
|
1655 |
+
* $I->dontSeeElement('.error');
|
1656 |
+
* $I->dontSeeElement('//form/input[1]');
|
1657 |
+
* $I->dontSeeElement('input', ['name' => 'login']);
|
1658 |
+
* $I->dontSeeElement('input', ['value' => '123456']);
|
1659 |
+
* ?>
|
1660 |
+
* ```
|
1661 |
+
*
|
1662 |
+
* @param $selector
|
1663 |
+
* @param array $attributes
|
1664 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeElement()
|
1665 |
+
*/
|
1666 |
+
public function dontSeeElement($selector, $attributes = null) {
|
1667 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeElement', func_get_args()));
|
1668 |
+
}
|
1669 |
+
|
1670 |
+
|
1671 |
+
/**
|
1672 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1673 |
+
*
|
1674 |
+
* Checks that there are a certain number of elements matched by the given locator on the page.
|
1675 |
+
*
|
1676 |
+
* ``` php
|
1677 |
+
* <?php
|
1678 |
+
* $I->seeNumberOfElements('tr', 10);
|
1679 |
+
* $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements
|
1680 |
+
* ?>
|
1681 |
+
* ```
|
1682 |
+
* @param $selector
|
1683 |
+
* @param mixed $expected:
|
1684 |
+
* - string: strict number
|
1685 |
+
* - array: range of numbers [0,10]
|
1686 |
+
* Conditional Assertion: Test won't be stopped on fail
|
1687 |
+
* @see \Codeception\Lib\InnerBrowser::seeNumberOfElements()
|
1688 |
+
*/
|
1689 |
+
public function canSeeNumberOfElements($selector, $expected) {
|
1690 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElements', func_get_args()));
|
1691 |
+
}
|
1692 |
+
/**
|
1693 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1694 |
+
*
|
1695 |
+
* Checks that there are a certain number of elements matched by the given locator on the page.
|
1696 |
+
*
|
1697 |
+
* ``` php
|
1698 |
+
* <?php
|
1699 |
+
* $I->seeNumberOfElements('tr', 10);
|
1700 |
+
* $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements
|
1701 |
+
* ?>
|
1702 |
+
* ```
|
1703 |
+
* @param $selector
|
1704 |
+
* @param mixed $expected:
|
1705 |
+
* - string: strict number
|
1706 |
+
* - array: range of numbers [0,10]
|
1707 |
+
* @see \Codeception\Lib\InnerBrowser::seeNumberOfElements()
|
1708 |
+
*/
|
1709 |
+
public function seeNumberOfElements($selector, $expected) {
|
1710 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeNumberOfElements', func_get_args()));
|
1711 |
+
}
|
1712 |
+
|
1713 |
+
|
1714 |
+
/**
|
1715 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1716 |
+
*
|
1717 |
+
* Checks that the given option is selected.
|
1718 |
+
*
|
1719 |
+
* ``` php
|
1720 |
+
* <?php
|
1721 |
+
* $I->seeOptionIsSelected('#form input[name=payment]', 'Visa');
|
1722 |
+
* ?>
|
1723 |
+
* ```
|
1724 |
+
*
|
1725 |
+
* @param $selector
|
1726 |
+
* @param $optionText
|
1727 |
+
*
|
1728 |
+
* @return mixed
|
1729 |
+
* Conditional Assertion: Test won't be stopped on fail
|
1730 |
+
* @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected()
|
1731 |
+
*/
|
1732 |
+
public function canSeeOptionIsSelected($select, $optionText) {
|
1733 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args()));
|
1734 |
+
}
|
1735 |
+
/**
|
1736 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1737 |
+
*
|
1738 |
+
* Checks that the given option is selected.
|
1739 |
+
*
|
1740 |
+
* ``` php
|
1741 |
+
* <?php
|
1742 |
+
* $I->seeOptionIsSelected('#form input[name=payment]', 'Visa');
|
1743 |
+
* ?>
|
1744 |
+
* ```
|
1745 |
+
*
|
1746 |
+
* @param $selector
|
1747 |
+
* @param $optionText
|
1748 |
+
*
|
1749 |
+
* @return mixed
|
1750 |
+
* @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected()
|
1751 |
+
*/
|
1752 |
+
public function seeOptionIsSelected($select, $optionText) {
|
1753 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args()));
|
1754 |
+
}
|
1755 |
+
|
1756 |
+
|
1757 |
+
/**
|
1758 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1759 |
+
*
|
1760 |
+
* Checks that the given option is not selected.
|
1761 |
+
*
|
1762 |
+
* ``` php
|
1763 |
+
* <?php
|
1764 |
+
* $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
|
1765 |
+
* ?>
|
1766 |
+
* ```
|
1767 |
+
*
|
1768 |
+
* @param $selector
|
1769 |
+
* @param $optionText
|
1770 |
+
*
|
1771 |
+
* @return mixed
|
1772 |
+
* Conditional Assertion: Test won't be stopped on fail
|
1773 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected()
|
1774 |
+
*/
|
1775 |
+
public function cantSeeOptionIsSelected($select, $optionText) {
|
1776 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args()));
|
1777 |
+
}
|
1778 |
+
/**
|
1779 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1780 |
+
*
|
1781 |
+
* Checks that the given option is not selected.
|
1782 |
+
*
|
1783 |
+
* ``` php
|
1784 |
+
* <?php
|
1785 |
+
* $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
|
1786 |
+
* ?>
|
1787 |
+
* ```
|
1788 |
+
*
|
1789 |
+
* @param $selector
|
1790 |
+
* @param $optionText
|
1791 |
+
*
|
1792 |
+
* @return mixed
|
1793 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected()
|
1794 |
+
*/
|
1795 |
+
public function dontSeeOptionIsSelected($select, $optionText) {
|
1796 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeOptionIsSelected', func_get_args()));
|
1797 |
+
}
|
1798 |
+
|
1799 |
+
|
1800 |
+
/**
|
1801 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1802 |
+
*
|
1803 |
+
* Asserts that current page has 404 response status code.
|
1804 |
+
* Conditional Assertion: Test won't be stopped on fail
|
1805 |
+
* @see \Codeception\Lib\InnerBrowser::seePageNotFound()
|
1806 |
+
*/
|
1807 |
+
public function canSeePageNotFound() {
|
1808 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seePageNotFound', func_get_args()));
|
1809 |
+
}
|
1810 |
+
/**
|
1811 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1812 |
+
*
|
1813 |
+
* Asserts that current page has 404 response status code.
|
1814 |
+
* @see \Codeception\Lib\InnerBrowser::seePageNotFound()
|
1815 |
+
*/
|
1816 |
+
public function seePageNotFound() {
|
1817 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('seePageNotFound', func_get_args()));
|
1818 |
+
}
|
1819 |
+
|
1820 |
+
|
1821 |
+
/**
|
1822 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1823 |
+
*
|
1824 |
+
* Checks that response code is equal to value provided.
|
1825 |
+
*
|
1826 |
+
* @param $code
|
1827 |
+
*
|
1828 |
+
* @return mixed
|
1829 |
+
* Conditional Assertion: Test won't be stopped on fail
|
1830 |
+
* @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs()
|
1831 |
+
*/
|
1832 |
+
public function canSeeResponseCodeIs($code) {
|
1833 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIs', func_get_args()));
|
1834 |
+
}
|
1835 |
+
/**
|
1836 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1837 |
+
*
|
1838 |
+
* Checks that response code is equal to value provided.
|
1839 |
+
*
|
1840 |
+
* @param $code
|
1841 |
+
*
|
1842 |
+
* @return mixed
|
1843 |
+
* @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs()
|
1844 |
+
*/
|
1845 |
+
public function seeResponseCodeIs($code) {
|
1846 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeResponseCodeIs', func_get_args()));
|
1847 |
+
}
|
1848 |
+
|
1849 |
+
|
1850 |
+
/**
|
1851 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1852 |
+
*
|
1853 |
+
* Checks that the page title contains the given string.
|
1854 |
+
*
|
1855 |
+
* ``` php
|
1856 |
+
* <?php
|
1857 |
+
* $I->seeInTitle('Blog - Post #1');
|
1858 |
+
* ?>
|
1859 |
+
* ```
|
1860 |
+
*
|
1861 |
+
* @param $title
|
1862 |
+
*
|
1863 |
+
* @return mixed
|
1864 |
+
* Conditional Assertion: Test won't be stopped on fail
|
1865 |
+
* @see \Codeception\Lib\InnerBrowser::seeInTitle()
|
1866 |
+
*/
|
1867 |
+
public function canSeeInTitle($title) {
|
1868 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInTitle', func_get_args()));
|
1869 |
+
}
|
1870 |
+
/**
|
1871 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1872 |
+
*
|
1873 |
+
* Checks that the page title contains the given string.
|
1874 |
+
*
|
1875 |
+
* ``` php
|
1876 |
+
* <?php
|
1877 |
+
* $I->seeInTitle('Blog - Post #1');
|
1878 |
+
* ?>
|
1879 |
+
* ```
|
1880 |
+
*
|
1881 |
+
* @param $title
|
1882 |
+
*
|
1883 |
+
* @return mixed
|
1884 |
+
* @see \Codeception\Lib\InnerBrowser::seeInTitle()
|
1885 |
+
*/
|
1886 |
+
public function seeInTitle($title) {
|
1887 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInTitle', func_get_args()));
|
1888 |
+
}
|
1889 |
+
|
1890 |
+
|
1891 |
+
/**
|
1892 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1893 |
+
*
|
1894 |
+
* Checks that the page title does not contain the given string.
|
1895 |
+
*
|
1896 |
+
* @param $title
|
1897 |
+
*
|
1898 |
+
* @return mixed
|
1899 |
+
* Conditional Assertion: Test won't be stopped on fail
|
1900 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeInTitle()
|
1901 |
+
*/
|
1902 |
+
public function cantSeeInTitle($title) {
|
1903 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInTitle', func_get_args()));
|
1904 |
+
}
|
1905 |
+
/**
|
1906 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1907 |
+
*
|
1908 |
+
* Checks that the page title does not contain the given string.
|
1909 |
+
*
|
1910 |
+
* @param $title
|
1911 |
+
*
|
1912 |
+
* @return mixed
|
1913 |
+
* @see \Codeception\Lib\InnerBrowser::dontSeeInTitle()
|
1914 |
+
*/
|
1915 |
+
public function dontSeeInTitle($title) {
|
1916 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInTitle', func_get_args()));
|
1917 |
+
}
|
1918 |
+
}
|
assets/tests/codeception/acceptance/LoginCept.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* - login
|
4 |
+
* - navigate to plugins
|
5 |
+
* - verify landing pages is installed
|
6 |
+
* - deactivate landing pages
|
7 |
+
* - activate landing pages
|
8 |
+
* - confirm welcome page shows
|
9 |
+
*
|
10 |
+
*/
|
11 |
+
|
12 |
+
|
13 |
+
$I = new AcceptanceTester($scenario);
|
14 |
+
|
15 |
+
|
16 |
+
$I->wantTo('login to wp-admin');
|
17 |
+
$I->amOnPage( site_url().'/wp-login.php' );
|
18 |
+
$I->fillField('Username or Email', 'admin');
|
19 |
+
$I->fillField('Password','admin');
|
20 |
+
$I->click('Log In');
|
21 |
+
$I->see('Dashboard');
|
22 |
+
|
23 |
+
|
24 |
+
$I->wantTo('Navigate to plugins');
|
25 |
+
$I->click( [ 'link' => 'Installed Plugins']);
|
26 |
+
$I->see('Plugins');
|
27 |
+
$I->see('Landing Pages');
|
28 |
+
$I->see('Calls to Action');
|
29 |
+
$I->see('Leads');
|
30 |
+
|
31 |
+
$I->wantTo('Verify landing pages is installed');
|
32 |
+
|
33 |
+
$I->click( '.active a');
|
34 |
+
$I->see('Landing Pages');
|
35 |
+
$I->seePluginActivated('landing-pages');
|
36 |
+
$I->seePluginActivated('calls-to-action');
|
37 |
+
$I->seePluginActivated('leads');
|
38 |
+
|
39 |
+
$I->wantTo('Deactivate Landing Pages');
|
40 |
+
$I->deactivatePlugin( 'landing-pages');
|
41 |
+
$I->seePluginDeactivated('landing-pages');
|
42 |
+
|
43 |
+
$I->wantTo('Reactivate Landing Pages');
|
44 |
+
$I->activatePlugin( 'landing-pages');
|
45 |
+
|
46 |
+
$I->wantTo('Confirm welcome page');
|
47 |
+
$I->see('Welcome to WordPress Landing Pages ');
|
48 |
+
|
assets/tests/codeception/acceptance/StatisticsCept.php
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This test is desnged to test the impressions/conversions systems of landing pages.
|
4 |
+
* Systems tested:
|
5 |
+
* [x] Login to WordPress
|
6 |
+
* [x] Navigate to Landing Pages
|
7 |
+
* [x] Open example landing page
|
8 |
+
* [x] Check if impression/conversion UI display on landing page edit screen
|
9 |
+
* [ ] Reset impressions/conversions and refresh page
|
10 |
+
* [ ] Make sure stats read 0
|
11 |
+
* [ ] Open landing page and make sure it does not 404
|
12 |
+
* [ ] Refresh landing page and make sure variation 2 loads
|
13 |
+
* [ ] Submit test conversion on variation 2
|
14 |
+
* [ ] Navigate back to edit page and make sure stats read correctly
|
15 |
+
*/
|
16 |
+
|
17 |
+
$I = new AcceptanceTester($scenario);
|
18 |
+
|
19 |
+
$I->wantTo('login to wp-admin');
|
20 |
+
$I->amOnPage( site_url().'/wp-login.php' );
|
21 |
+
$I->fillField('Username', 'admin');
|
22 |
+
$I->fillField('Password','admin');
|
23 |
+
$I->click('Log In');
|
24 |
+
$I->see('Dashboard');
|
25 |
+
|
26 |
+
$I->wantTo('Navigate to landing pages list');
|
27 |
+
$I->click('Landing Pages');
|
28 |
+
$I->amOnPage( admin_url( 'edit.php?post_type=landing-page') );
|
29 |
+
$I->see( 'Landing Pages');
|
30 |
+
|
31 |
+
$I->wantTo('Open example landing page');
|
32 |
+
$I->click( [ 'link' => 'A/B Testing Landing Page Example']);
|
33 |
+
$I->wantTo('check if impressions are correct for variation a');
|
34 |
+
$imp = $I->grabTextFrom('#lp-variation-A .stat-span-impressions');
|
35 |
+
$I->assertContains( '30' , $imp );
|
36 |
+
|
37 |
+
$I->wantTo('check check impressions for variation b');
|
38 |
+
$imp = $I->grabTextFrom('#lp-variation-B .stat-span-impressions');
|
39 |
+
$I->assertContains( '35' , $imp , '' );
|
40 |
+
|
41 |
+
$I->wantTo('check conversions for variation a');
|
42 |
+
$con = $I->grabTextFrom('#lp-variation-A .stat-span-conversions');
|
43 |
+
$I->assertContains( '10' , $con , '' );
|
44 |
+
|
45 |
+
$I->wantTo('check conversions for variation b');
|
46 |
+
$con = $I->grabTextFrom('#lp-variation-B .stat-span-conversions');
|
47 |
+
$I->assertContains( '15' , $con );
|
48 |
+
|
49 |
+
$I->wantTo('check the conversion rate of variation a');
|
50 |
+
$per = $I->grabTextFrom('#lp-variation-A .stat-span-conversion_rate');
|
51 |
+
$I->assertContains( '33' , $per );
|
52 |
+
|
53 |
+
$I->wantTo('check the conversion rate of variation b');
|
54 |
+
$per = $I->grabTextFrom('#lp-variation-B .stat-span-conversion_rate');
|
55 |
+
$I->assertContains( '42.86' , $per );
|
assets/tests/codeception/acceptance/WelcomeCept.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$I = new AcceptanceTester($scenario);
|
4 |
+
$I->wantTo('Make sure the default WordPress homepage loads.');
|
5 |
+
$I->amOnPage( site_url() );
|
6 |
+
$I->see('Hello world!');
|
7 |
+
|
assets/tests/codeception/acceptance/_bootstrap.php
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Here you can initialize variables that will be available to your tests
|
assets/tests/codeception/functional/FunctionalTester.php
ADDED
@@ -0,0 +1,360 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php //[STAMP] fa259e6277a310881c0cdeb89563ce4c
|
2 |
+
|
3 |
+
// This class was automatically generated by build task
|
4 |
+
// You should not change it manually as it will be overwritten on next build
|
5 |
+
// @codingStandardsIgnoreFile
|
6 |
+
|
7 |
+
|
8 |
+
use Codeception\Module\Filesystem;
|
9 |
+
use Codeception\Module\FunctionalHelper;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Inherited Methods
|
13 |
+
* @method void wantToTest($text)
|
14 |
+
* @method void wantTo($text)
|
15 |
+
* @method void execute($callable)
|
16 |
+
* @method void expectTo($prediction)
|
17 |
+
* @method void expect($prediction)
|
18 |
+
* @method void amGoingTo($argumentation)
|
19 |
+
* @method void am($role)
|
20 |
+
* @method void lookForwardTo($achieveValue)
|
21 |
+
* @method void comment($description)
|
22 |
+
* @method void haveFriend($name, $actorClass = null)
|
23 |
+
*
|
24 |
+
* @SuppressWarnings(PHPMD)
|
25 |
+
*/
|
26 |
+
class FunctionalTester extends \Codeception\Actor
|
27 |
+
{
|
28 |
+
|
29 |
+
/**
|
30 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
31 |
+
*
|
32 |
+
* Enters a directory In local filesystem.
|
33 |
+
* Project root directory is used by default
|
34 |
+
*
|
35 |
+
* @param $path
|
36 |
+
* @see \Codeception\Module\Filesystem::amInPath()
|
37 |
+
*/
|
38 |
+
public function amInPath($path) {
|
39 |
+
return $this->scenario->runStep(new \Codeception\Step\Condition('amInPath', func_get_args()));
|
40 |
+
}
|
41 |
+
|
42 |
+
|
43 |
+
/**
|
44 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
45 |
+
*
|
46 |
+
* Opens a file and stores it's content.
|
47 |
+
*
|
48 |
+
* Usage:
|
49 |
+
*
|
50 |
+
* ``` php
|
51 |
+
* <?php
|
52 |
+
* $I->openFile('composer.json');
|
53 |
+
* $I->seeInThisFile('codeception/codeception');
|
54 |
+
* ?>
|
55 |
+
* ```
|
56 |
+
*
|
57 |
+
* @param $filename
|
58 |
+
* @see \Codeception\Module\Filesystem::openFile()
|
59 |
+
*/
|
60 |
+
public function openFile($filename) {
|
61 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('openFile', func_get_args()));
|
62 |
+
}
|
63 |
+
|
64 |
+
|
65 |
+
/**
|
66 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
67 |
+
*
|
68 |
+
* Deletes a file
|
69 |
+
*
|
70 |
+
* ``` php
|
71 |
+
* <?php
|
72 |
+
* $I->deleteFile('composer.lock');
|
73 |
+
* ?>
|
74 |
+
* ```
|
75 |
+
*
|
76 |
+
* @param $filename
|
77 |
+
* @see \Codeception\Module\Filesystem::deleteFile()
|
78 |
+
*/
|
79 |
+
public function deleteFile($filename) {
|
80 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('deleteFile', func_get_args()));
|
81 |
+
}
|
82 |
+
|
83 |
+
|
84 |
+
/**
|
85 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
86 |
+
*
|
87 |
+
* Deletes directory with all subdirectories
|
88 |
+
*
|
89 |
+
* ``` php
|
90 |
+
* <?php
|
91 |
+
* $I->deleteDir('vendor');
|
92 |
+
* ?>
|
93 |
+
* ```
|
94 |
+
*
|
95 |
+
* @param $dirname
|
96 |
+
* @see \Codeception\Module\Filesystem::deleteDir()
|
97 |
+
*/
|
98 |
+
public function deleteDir($dirname) {
|
99 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('deleteDir', func_get_args()));
|
100 |
+
}
|
101 |
+
|
102 |
+
|
103 |
+
/**
|
104 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
105 |
+
*
|
106 |
+
* Copies directory with all contents
|
107 |
+
*
|
108 |
+
* ``` php
|
109 |
+
* <?php
|
110 |
+
* $I->copyDir('vendor','old_vendor');
|
111 |
+
* ?>
|
112 |
+
* ```
|
113 |
+
*
|
114 |
+
* @param $src
|
115 |
+
* @param $dst
|
116 |
+
* @see \Codeception\Module\Filesystem::copyDir()
|
117 |
+
*/
|
118 |
+
public function copyDir($src, $dst) {
|
119 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('copyDir', func_get_args()));
|
120 |
+
}
|
121 |
+
|
122 |
+
|
123 |
+
/**
|
124 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
125 |
+
*
|
126 |
+
* Checks If opened file has `text` in it.
|
127 |
+
*
|
128 |
+
* Usage:
|
129 |
+
*
|
130 |
+
* ``` php
|
131 |
+
* <?php
|
132 |
+
* $I->openFile('composer.json');
|
133 |
+
* $I->seeInThisFile('codeception/codeception');
|
134 |
+
* ?>
|
135 |
+
* ```
|
136 |
+
*
|
137 |
+
* @param $text
|
138 |
+
* Conditional Assertion: Test won't be stopped on fail
|
139 |
+
* @see \Codeception\Module\Filesystem::seeInThisFile()
|
140 |
+
*/
|
141 |
+
public function canSeeInThisFile($text) {
|
142 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInThisFile', func_get_args()));
|
143 |
+
}
|
144 |
+
/**
|
145 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
146 |
+
*
|
147 |
+
* Checks If opened file has `text` in it.
|
148 |
+
*
|
149 |
+
* Usage:
|
150 |
+
*
|
151 |
+
* ``` php
|
152 |
+
* <?php
|
153 |
+
* $I->openFile('composer.json');
|
154 |
+
* $I->seeInThisFile('codeception/codeception');
|
155 |
+
* ?>
|
156 |
+
* ```
|
157 |
+
*
|
158 |
+
* @param $text
|
159 |
+
* @see \Codeception\Module\Filesystem::seeInThisFile()
|
160 |
+
*/
|
161 |
+
public function seeInThisFile($text) {
|
162 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInThisFile', func_get_args()));
|
163 |
+
}
|
164 |
+
|
165 |
+
|
166 |
+
/**
|
167 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
168 |
+
*
|
169 |
+
* Checks the strict matching of file contents.
|
170 |
+
* Unlike `seeInThisFile` will fail if file has something more than expected lines.
|
171 |
+
* Better to use with HEREDOC strings.
|
172 |
+
* Matching is done after removing "\r" chars from file content.
|
173 |
+
*
|
174 |
+
* ``` php
|
175 |
+
* <?php
|
176 |
+
* $I->openFile('process.pid');
|
177 |
+
* $I->seeFileContentsEqual('3192');
|
178 |
+
* ?>
|
179 |
+
* ```
|
180 |
+
*
|
181 |
+
* @param $text
|
182 |
+
* Conditional Assertion: Test won't be stopped on fail
|
183 |
+
* @see \Codeception\Module\Filesystem::seeFileContentsEqual()
|
184 |
+
*/
|
185 |
+
public function canSeeFileContentsEqual($text) {
|
186 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileContentsEqual', func_get_args()));
|
187 |
+
}
|
188 |
+
/**
|
189 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
190 |
+
*
|
191 |
+
* Checks the strict matching of file contents.
|
192 |
+
* Unlike `seeInThisFile` will fail if file has something more than expected lines.
|
193 |
+
* Better to use with HEREDOC strings.
|
194 |
+
* Matching is done after removing "\r" chars from file content.
|
195 |
+
*
|
196 |
+
* ``` php
|
197 |
+
* <?php
|
198 |
+
* $I->openFile('process.pid');
|
199 |
+
* $I->seeFileContentsEqual('3192');
|
200 |
+
* ?>
|
201 |
+
* ```
|
202 |
+
*
|
203 |
+
* @param $text
|
204 |
+
* @see \Codeception\Module\Filesystem::seeFileContentsEqual()
|
205 |
+
*/
|
206 |
+
public function seeFileContentsEqual($text) {
|
207 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileContentsEqual', func_get_args()));
|
208 |
+
}
|
209 |
+
|
210 |
+
|
211 |
+
/**
|
212 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
213 |
+
*
|
214 |
+
* Checks If opened file doesn't contain `text` in it
|
215 |
+
*
|
216 |
+
* ``` php
|
217 |
+
* <?php
|
218 |
+
* $I->openFile('composer.json');
|
219 |
+
* $I->dontSeeInThisFile('codeception/codeception');
|
220 |
+
* ?>
|
221 |
+
* ```
|
222 |
+
*
|
223 |
+
* @param $text
|
224 |
+
* Conditional Assertion: Test won't be stopped on fail
|
225 |
+
* @see \Codeception\Module\Filesystem::dontSeeInThisFile()
|
226 |
+
*/
|
227 |
+
public function cantSeeInThisFile($text) {
|
228 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInThisFile', func_get_args()));
|
229 |
+
}
|
230 |
+
/**
|
231 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
232 |
+
*
|
233 |
+
* Checks If opened file doesn't contain `text` in it
|
234 |
+
*
|
235 |
+
* ``` php
|
236 |
+
* <?php
|
237 |
+
* $I->openFile('composer.json');
|
238 |
+
* $I->dontSeeInThisFile('codeception/codeception');
|
239 |
+
* ?>
|
240 |
+
* ```
|
241 |
+
*
|
242 |
+
* @param $text
|
243 |
+
* @see \Codeception\Module\Filesystem::dontSeeInThisFile()
|
244 |
+
*/
|
245 |
+
public function dontSeeInThisFile($text) {
|
246 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInThisFile', func_get_args()));
|
247 |
+
}
|
248 |
+
|
249 |
+
|
250 |
+
/**
|
251 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
252 |
+
*
|
253 |
+
* Deletes a file
|
254 |
+
* @see \Codeception\Module\Filesystem::deleteThisFile()
|
255 |
+
*/
|
256 |
+
public function deleteThisFile() {
|
257 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('deleteThisFile', func_get_args()));
|
258 |
+
}
|
259 |
+
|
260 |
+
|
261 |
+
/**
|
262 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
263 |
+
*
|
264 |
+
* Checks if file exists in path.
|
265 |
+
* Opens a file when it's exists
|
266 |
+
*
|
267 |
+
* ``` php
|
268 |
+
* <?php
|
269 |
+
* $I->seeFileFound('UserModel.php','app/models');
|
270 |
+
* ?>
|
271 |
+
* ```
|
272 |
+
*
|
273 |
+
* @param $filename
|
274 |
+
* @param string $path
|
275 |
+
* Conditional Assertion: Test won't be stopped on fail
|
276 |
+
* @see \Codeception\Module\Filesystem::seeFileFound()
|
277 |
+
*/
|
278 |
+
public function canSeeFileFound($filename, $path = null) {
|
279 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileFound', func_get_args()));
|
280 |
+
}
|
281 |
+
/**
|
282 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
283 |
+
*
|
284 |
+
* Checks if file exists in path.
|
285 |
+
* Opens a file when it's exists
|
286 |
+
*
|
287 |
+
* ``` php
|
288 |
+
* <?php
|
289 |
+
* $I->seeFileFound('UserModel.php','app/models');
|
290 |
+
* ?>
|
291 |
+
* ```
|
292 |
+
*
|
293 |
+
* @param $filename
|
294 |
+
* @param string $path
|
295 |
+
* @see \Codeception\Module\Filesystem::seeFileFound()
|
296 |
+
*/
|
297 |
+
public function seeFileFound($filename, $path = null) {
|
298 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileFound', func_get_args()));
|
299 |
+
}
|
300 |
+
|
301 |
+
|
302 |
+
/**
|
303 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
304 |
+
*
|
305 |
+
* Checks if file does not exists in path
|
306 |
+
*
|
307 |
+
* @param $filename
|
308 |
+
* @param string $path
|
309 |
+
* Conditional Assertion: Test won't be stopped on fail
|
310 |
+
* @see \Codeception\Module\Filesystem::dontSeeFileFound()
|
311 |
+
*/
|
312 |
+
public function cantSeeFileFound($filename, $path = null) {
|
313 |
+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeFileFound', func_get_args()));
|
314 |
+
}
|
315 |
+
/**
|
316 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
317 |
+
*
|
318 |
+
* Checks if file does not exists in path
|
319 |
+
*
|
320 |
+
* @param $filename
|
321 |
+
* @param string $path
|
322 |
+
* @see \Codeception\Module\Filesystem::dontSeeFileFound()
|
323 |
+
*/
|
324 |
+
public function dontSeeFileFound($filename, $path = null) {
|
325 |
+
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeFileFound', func_get_args()));
|
326 |
+
}
|
327 |
+
|
328 |
+
|
329 |
+
/**
|
330 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
331 |
+
*
|
332 |
+
* Erases directory contents
|
333 |
+
*
|
334 |
+
* ``` php
|
335 |
+
* <?php
|
336 |
+
* $I->cleanDir('logs');
|
337 |
+
* ?>
|
338 |
+
* ```
|
339 |
+
*
|
340 |
+
* @param $dirname
|
341 |
+
* @see \Codeception\Module\Filesystem::cleanDir()
|
342 |
+
*/
|
343 |
+
public function cleanDir($dirname) {
|
344 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('cleanDir', func_get_args()));
|
345 |
+
}
|
346 |
+
|
347 |
+
|
348 |
+
/**
|
349 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
350 |
+
*
|
351 |
+
* Saves contents to file
|
352 |
+
*
|
353 |
+
* @param $filename
|
354 |
+
* @param $contents
|
355 |
+
* @see \Codeception\Module\Filesystem::writeToFile()
|
356 |
+
*/
|
357 |
+
public function writeToFile($filename, $contents) {
|
358 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('writeToFile', func_get_args()));
|
359 |
+
}
|
360 |
+
}
|
assets/tests/codeception/functional/_bootstrap.php
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Here you can initialize variables that will be available to your tests
|
assets/tests/codeception/unit/UnitTester.php
ADDED
@@ -0,0 +1,300 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php //[STAMP] c8568e8eab4a240544c36ae031f88bd8
|
2 |
+
|
3 |
+
// This class was automatically generated by build task
|
4 |
+
// You should not change it manually as it will be overwritten on next build
|
5 |
+
// @codingStandardsIgnoreFile
|
6 |
+
|
7 |
+
|
8 |
+
use Codeception\Module\Asserts;
|
9 |
+
use Codeception\Module\UnitHelper;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Inherited Methods
|
13 |
+
* @method void wantToTest($text)
|
14 |
+
* @method void wantTo($text)
|
15 |
+
* @method void execute($callable)
|
16 |
+
* @method void expectTo($prediction)
|
17 |
+
* @method void expect($prediction)
|
18 |
+
* @method void amGoingTo($argumentation)
|
19 |
+
* @method void am($role)
|
20 |
+
* @method void lookForwardTo($achieveValue)
|
21 |
+
* @method void comment($description)
|
22 |
+
* @method void haveFriend($name, $actorClass = null)
|
23 |
+
*
|
24 |
+
* @SuppressWarnings(PHPMD)
|
25 |
+
*/
|
26 |
+
class UnitTester extends \Codeception\Actor
|
27 |
+
{
|
28 |
+
|
29 |
+
/**
|
30 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
31 |
+
*
|
32 |
+
* Checks that two variables are equal.
|
33 |
+
*
|
34 |
+
* @param $expected
|
35 |
+
* @param $actual
|
36 |
+
* @param string $message
|
37 |
+
*
|
38 |
+
* @return mixed
|
39 |
+
* @see \Codeception\Module\Asserts::assertEquals()
|
40 |
+
*/
|
41 |
+
public function assertEquals($expected, $actual, $message = null) {
|
42 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('assertEquals', func_get_args()));
|
43 |
+
}
|
44 |
+
|
45 |
+
|
46 |
+
/**
|
47 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
48 |
+
*
|
49 |
+
* Checks that two variables are not equal
|
50 |
+
*
|
51 |
+
* @param $expected
|
52 |
+
* @param $actual
|
53 |
+
* @param string $message
|
54 |
+
* @see \Codeception\Module\Asserts::assertNotEquals()
|
55 |
+
*/
|
56 |
+
public function assertNotEquals($expected, $actual, $message = null) {
|
57 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('assertNotEquals', func_get_args()));
|
58 |
+
}
|
59 |
+
|
60 |
+
|
61 |
+
/**
|
62 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
63 |
+
*
|
64 |
+
* Checks that two variables are same
|
65 |
+
*
|
66 |
+
* @param $expected
|
67 |
+
* @param $actual
|
68 |
+
* @param string $message
|
69 |
+
*
|
70 |
+
* @return mixed
|
71 |
+
* @see \Codeception\Module\Asserts::assertSame()
|
72 |
+
*/
|
73 |
+
public function assertSame($expected, $actual, $message = null) {
|
74 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('assertSame', func_get_args()));
|
75 |
+
}
|
76 |
+
|
77 |
+
|
78 |
+
/**
|
79 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
80 |
+
*
|
81 |
+
* Checks that two variables are not same
|
82 |
+
*
|
83 |
+
* @param $expected
|
84 |
+
* @param $actual
|
85 |
+
* @param string $message
|
86 |
+
* @see \Codeception\Module\Asserts::assertNotSame()
|
87 |
+
*/
|
88 |
+
public function assertNotSame($expected, $actual, $message = null) {
|
89 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('assertNotSame', func_get_args()));
|
90 |
+
}
|
91 |
+
|
92 |
+
|
93 |
+
/**
|
94 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
95 |
+
*
|
96 |
+
* Checks that expected is greater than actual
|
97 |
+
*
|
98 |
+
* @param $expected
|
99 |
+
* @param $actual
|
100 |
+
* @param string $message
|
101 |
+
* @see \Codeception\Module\Asserts::assertGreaterThan()
|
102 |
+
*/
|
103 |
+
public function assertGreaterThan($expected, $actual, $message = null) {
|
104 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('assertGreaterThan', func_get_args()));
|
105 |
+
}
|
106 |
+
|
107 |
+
|
108 |
+
/**
|
109 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
110 |
+
*
|
111 |
+
* @deprecated
|
112 |
+
* @see \Codeception\Module\Asserts::assertGreaterThen()
|
113 |
+
*/
|
114 |
+
public function assertGreaterThen($expected, $actual, $message = null) {
|
115 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('assertGreaterThen', func_get_args()));
|
116 |
+
}
|
117 |
+
|
118 |
+
|
119 |
+
/**
|
120 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
121 |
+
*
|
122 |
+
* Checks that expected is greater or equal than actual
|
123 |
+
*
|
124 |
+
* @param $expected
|
125 |
+
* @param $actual
|
126 |
+
* @param string $message
|
127 |
+
* @see \Codeception\Module\Asserts::assertGreaterThanOrEqual()
|
128 |
+
*/
|
129 |
+
public function assertGreaterThanOrEqual($expected, $actual, $message = null) {
|
130 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('assertGreaterThanOrEqual', func_get_args()));
|
131 |
+
}
|
132 |
+
|
133 |
+
|
134 |
+
/**
|
135 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
136 |
+
*
|
137 |
+
* @deprecated
|
138 |
+
* @see \Codeception\Module\Asserts::assertGreaterThenOrEqual()
|
139 |
+
*/
|
140 |
+
public function assertGreaterThenOrEqual($expected, $actual, $message = null) {
|
141 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('assertGreaterThenOrEqual', func_get_args()));
|
142 |
+
}
|
143 |
+
|
144 |
+
|
145 |
+
/**
|
146 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
147 |
+
*
|
148 |
+
* Checks that expected is less than actual
|
149 |
+
*
|
150 |
+
* @param $expected
|
151 |
+
* @param $actual
|
152 |
+
* @param string $message
|
153 |
+
* @see \Codeception\Module\Asserts::assertLessThan()
|
154 |
+
*/
|
155 |
+
public function assertLessThan($expected, $actual, $message = null) {
|
156 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('assertLessThan', func_get_args()));
|
157 |
+
}
|
158 |
+
|
159 |
+
|
160 |
+
/**
|
161 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
162 |
+
*
|
163 |
+
* Checks that expected is less or equal than actual
|
164 |
+
*
|
165 |
+
* @param $expected
|
166 |
+
* @param $actual
|
167 |
+
* @param string $message
|
168 |
+
* @see \Codeception\Module\Asserts::assertLessThanOrEqual()
|
169 |
+
*/
|
170 |
+
public function assertLessThanOrEqual($expected, $actual, $message = null) {
|
171 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('assertLessThanOrEqual', func_get_args()));
|
172 |
+
}
|
173 |
+
|
174 |
+
|
175 |
+
/**
|
176 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
177 |
+
*
|
178 |
+
* Checks that haystack contains needle
|
179 |
+
*
|
180 |
+
* @param $needle
|
181 |
+
* @param $haystack
|
182 |
+
* @param string $message
|
183 |
+
* @see \Codeception\Module\Asserts::assertContains()
|
184 |
+
*/
|
185 |
+
public function assertContains($needle, $haystack, $message = null) {
|
186 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('assertContains', func_get_args()));
|
187 |
+
}
|
188 |
+
|
189 |
+
|
190 |
+
/**
|
191 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
192 |
+
*
|
193 |
+
* Checks that haystack doesn't contain needle.
|
194 |
+
*
|
195 |
+
* @param $needle
|
196 |
+
* @param $haystack
|
197 |
+
* @param string $message
|
198 |
+
* @see \Codeception\Module\Asserts::assertNotContains()
|
199 |
+
*/
|
200 |
+
public function assertNotContains($needle, $haystack, $message = null) {
|
201 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('assertNotContains', func_get_args()));
|
202 |
+
}
|
203 |
+
|
204 |
+
|
205 |
+
/**
|
206 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
207 |
+
*
|
208 |
+
* Checks that variable is empty.
|
209 |
+
*
|
210 |
+
* @param $actual
|
211 |
+
* @param string $message
|
212 |
+
* @see \Codeception\Module\Asserts::assertEmpty()
|
213 |
+
*/
|
214 |
+
public function assertEmpty($actual, $message = null) {
|
215 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('assertEmpty', func_get_args()));
|
216 |
+
}
|
217 |
+
|
218 |
+
|
219 |
+
/**
|
220 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
221 |
+
*
|
222 |
+
* Checks that variable is not empty.
|
223 |
+
*
|
224 |
+
* @param $actual
|
225 |
+
* @param string $message
|
226 |
+
* @see \Codeception\Module\Asserts::assertNotEmpty()
|
227 |
+
*/
|
228 |
+
public function assertNotEmpty($actual, $message = null) {
|
229 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('assertNotEmpty', func_get_args()));
|
230 |
+
}
|
231 |
+
|
232 |
+
|
233 |
+
/**
|
234 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
235 |
+
*
|
236 |
+
* Checks that variable is NULL
|
237 |
+
*
|
238 |
+
* @param $actual
|
239 |
+
* @param string $message
|
240 |
+
* @see \Codeception\Module\Asserts::assertNull()
|
241 |
+
*/
|
242 |
+
public function assertNull($actual, $message = null) {
|
243 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('assertNull', func_get_args()));
|
244 |
+
}
|
245 |
+
|
246 |
+
|
247 |
+
/**
|
248 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
249 |
+
*
|
250 |
+
* Checks that variable is not NULL
|
251 |
+
*
|
252 |
+
* @param $actual
|
253 |
+
* @param string $message
|
254 |
+
* @see \Codeception\Module\Asserts::assertNotNull()
|
255 |
+
*/
|
256 |
+
public function assertNotNull($actual, $message = null) {
|
257 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('assertNotNull', func_get_args()));
|
258 |
+
}
|
259 |
+
|
260 |
+
|
261 |
+
/**
|
262 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
263 |
+
*
|
264 |
+
* Checks that condition is positive.
|
265 |
+
*
|
266 |
+
* @param $condition
|
267 |
+
* @param string $message
|
268 |
+
* @see \Codeception\Module\Asserts::assertTrue()
|
269 |
+
*/
|
270 |
+
public function assertTrue($condition, $message = null) {
|
271 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('assertTrue', func_get_args()));
|
272 |
+
}
|
273 |
+
|
274 |
+
|
275 |
+
/**
|
276 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
277 |
+
*
|
278 |
+
* Checks that condition is negative.
|
279 |
+
*
|
280 |
+
* @param $condition
|
281 |
+
* @param string $message
|
282 |
+
* @see \Codeception\Module\Asserts::assertFalse()
|
283 |
+
*/
|
284 |
+
public function assertFalse($condition, $message = null) {
|
285 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('assertFalse', func_get_args()));
|
286 |
+
}
|
287 |
+
|
288 |
+
|
289 |
+
/**
|
290 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
291 |
+
*
|
292 |
+
* Fails the test with message.
|
293 |
+
*
|
294 |
+
* @param $message
|
295 |
+
* @see \Codeception\Module\Asserts::fail()
|
296 |
+
*/
|
297 |
+
public function fail($message) {
|
298 |
+
return $this->scenario->runStep(new \Codeception\Step\Action('fail', func_get_args()));
|
299 |
+
}
|
300 |
+
}
|
assets/tests/codeception/unit/_bootstrap.php
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Here you can initialize variables that will be available to your tests
|
assets/tests/phpunit/bootstrap.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Bootstrap the plugin unit testing environment.
|
4 |
+
*
|
5 |
+
* @package wordpress-plugin-tests
|
6 |
+
*/
|
7 |
+
|
8 |
+
/* load wp environemnt */
|
9 |
+
require '../../../wp-load.php';
|
10 |
+
|
11 |
+
/* load plugins */
|
12 |
+
require '../../../wp-admin/includes/plugin.php';
|
13 |
+
|
14 |
+
|
15 |
+
|
assets/tests/phpunit/test.activations.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Tests to test that that testing framework is testing tests. Meta, huh?
|
5 |
+
*
|
6 |
+
* @package wordpress-plugins-tests
|
7 |
+
*/
|
8 |
+
class Tests_Activation extends PHPUnit_Framework_TestCase {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Run a simple test to ensure that the tests are running
|
12 |
+
*/
|
13 |
+
function test_tests() {
|
14 |
+
$this->assertTrue( true );
|
15 |
+
}
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Ensure landing pages is active
|
19 |
+
*
|
20 |
+
function test_lading_pages_activated() {
|
21 |
+
$this->assertTrue( is_plugin_active( 'landing-pages/landing-pages.php' ) );
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Ensure that the Leads has been installed and activated.
|
26 |
+
*
|
27 |
+
function test_leads_activated() {
|
28 |
+
$this->assertTrue( is_plugin_active( 'leads/leads.php' ) );
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Ensure that the Calls to Action has been installed and activated.
|
33 |
+
*
|
34 |
+
function test_cta_activated() {
|
35 |
+
$this->assertTrue( is_plugin_active( 'cta/calls-to-action.php' ) );
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Run upgrade routines and check option to see if complete
|
40 |
+
*
|
41 |
+
function test_run_upgrade_routines() {
|
42 |
+
include_once LANDINGPAGES_PATH . 'classes/class.activation.php';
|
43 |
+
include_once LANDINGPAGES_PATH . 'classes/class.activation.upgrade-routines.php';
|
44 |
+
Landing_Pages_Activation::run_updates();
|
45 |
+
$this->assertTrue( true );
|
46 |
+
}*/
|
47 |
+
|
48 |
+
}
|
49 |
+
|
assets/tests/travis-ci/test.statistics.php
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Tests to test that that testing framework is testing tests. Meta, huh?
|
5 |
+
*
|
6 |
+
* @package wordpress-plugins-tests
|
7 |
+
*/
|
8 |
+
class Tests_Statistics extends WP_UnitTestCase {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Test to see if get_post works.
|
12 |
+
*
|
13 |
+
* Compares a post ID ($org_post_id) with post ID
|
14 |
+
* taken out of get_post ($new_post_id).
|
15 |
+
* If they don't match, get_post() doesn't work, and it will
|
16 |
+
* return an error.
|
17 |
+
*/
|
18 |
+
function test_get_post() {
|
19 |
+
//Create new post using method provided by WP
|
20 |
+
$org_post_id = $this->factory->post->create();
|
21 |
+
|
22 |
+
//get post object using the new post's ID
|
23 |
+
$post_obj = get_post( $org_post_id );
|
24 |
+
|
25 |
+
//Get the post ID as given to us by get_post
|
26 |
+
$new_post_id = $post_obj->ID;
|
27 |
+
|
28 |
+
//Use pre-defined method to test if the two ID's match
|
29 |
+
$this->assertEquals( $org_post_id, $new_post_id );
|
30 |
+
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* creates a dummy landing page for testing
|
35 |
+
*/
|
36 |
+
function test_create_demo_lander() {
|
37 |
+
/* load the class used to create the dummy landing page */
|
38 |
+
include_once LANDINGPAGES_PATH . 'modules/module.install.php';
|
39 |
+
$lp_id = inbound_create_default_post_type();
|
40 |
+
$this->assertEquals( $lp_id , 4 );
|
41 |
+
echo 1;
|
42 |
+
}
|
43 |
+
|
44 |
+
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Check if landing-page post type exists
|
48 |
+
*/
|
49 |
+
function test_check_if_landing_page_post_type_exist() {
|
50 |
+
$this->assertTrue( post_type_exists( 'landing-page' ) );
|
51 |
+
}
|
52 |
+
|
53 |
+
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Set landing page stats to zero for testing
|
57 |
+
*/
|
58 |
+
function test_reset_landing_page_stats() {
|
59 |
+
echo 2;
|
60 |
+
print_r( get_option( 'lp_settings_general' ) );
|
61 |
+
$landing_page = get_post( 4 );
|
62 |
+
var_dump($landing_page);
|
63 |
+
|
64 |
+
}
|
65 |
+
|
66 |
+
}
|
67 |
+
|
68 |
+
|
classes/class.click-tracking.php
CHANGED
@@ -12,7 +12,6 @@ class Landing_Pages_Click_Tracking {
|
|
12 |
public static function add_hooks() {
|
13 |
|
14 |
add_action('wp_footer', array( __CLASS__ , 'build_trackable_links') );
|
15 |
-
/* Click Tracking init */
|
16 |
add_action('init', array( __CLASS__ , 'intecept_tracked_link' ), 11);
|
17 |
}
|
18 |
|
@@ -49,7 +48,7 @@ class Landing_Pages_Click_Tracking {
|
|
49 |
}
|
50 |
|
51 |
var external = RegExp('^((f|ht)tps?:)?//(?!' + location.host + ')');
|
52 |
-
jQuery('.wpl-track-me-link
|
53 |
|
54 |
jQuery(this).attr("data-event-id", '<?php echo $post->ID; ?>').attr("data-cta-varation", '<?php echo $variation;?>');
|
55 |
|
@@ -208,4 +207,4 @@ class Landing_Pages_Click_Tracking {
|
|
208 |
|
209 |
}
|
210 |
|
211 |
-
new Landing_Pages_Click_Tracking;
|
12 |
public static function add_hooks() {
|
13 |
|
14 |
add_action('wp_footer', array( __CLASS__ , 'build_trackable_links') );
|
|
|
15 |
add_action('init', array( __CLASS__ , 'intecept_tracked_link' ), 11);
|
16 |
}
|
17 |
|
48 |
}
|
49 |
|
50 |
var external = RegExp('^((f|ht)tps?:)?//(?!' + location.host + ')');
|
51 |
+
jQuery('.wpl-track-me-link a').not("#wpadminbar a").each(function () {
|
52 |
|
53 |
jQuery(this).attr("data-event-id", '<?php echo $post->ID; ?>').attr("data-cta-varation", '<?php echo $variation;?>');
|
54 |
|
207 |
|
208 |
}
|
209 |
|
210 |
+
new Landing_Pages_Click_Tracking;
|
classes/class.sidebars.php
CHANGED
@@ -48,27 +48,50 @@ class Landing_Pages_Sidebars {
|
|
48 |
return;
|
49 |
}
|
50 |
|
51 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
if (!is_active_sidebar('lp_sidebar')) {
|
54 |
$active_widgets = get_option('sidebars_widgets');
|
55 |
-
$active_widgets
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
57 |
}
|
58 |
|
59 |
-
$stop = 0;
|
60 |
-
foreach ($original_widgets as $key => $val) {
|
61 |
|
62 |
-
|
|
|
|
|
|
|
|
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
|
|
|
|
|
|
|
|
|
67 |
$_wp_sidebars_widgets[$key] = $_wp_sidebars_widgets['lp_sidebar'];
|
68 |
-
$stop = 1;
|
69 |
}
|
|
|
70 |
}
|
71 |
|
|
|
|
|
|
|
72 |
|
73 |
}
|
74 |
}
|
48 |
return;
|
49 |
}
|
50 |
|
51 |
+
$whitelist = array('sidebar-1','sidebar-left','primary','default','blog','sidebar-right','blog-sidebar','left-sidebar','right-sidebar');
|
52 |
+
|
53 |
+
/* get correct registered widget */
|
54 |
+
$registered_widget_id = 'id_lp_conversion_area_widget-1';
|
55 |
+
foreach ($wp_registered_widgets as $key => $array ) {
|
56 |
+
if (strstr($key , 'id_lp_conversion_area_widget')) {
|
57 |
+
$registered_widget_id = $key;
|
58 |
+
break;
|
59 |
+
}
|
60 |
+
}
|
61 |
|
62 |
if (!is_active_sidebar('lp_sidebar')) {
|
63 |
$active_widgets = get_option('sidebars_widgets');
|
64 |
+
$active_widgets = get_option('sidebars_widgets');
|
65 |
+
|
66 |
+
if (!isset($active_widgets['lp_sidebar']) || !$active_widgets['lp_sidebar'] ) {
|
67 |
+
$active_widgets['lp_sidebar'] = array($registered_widget_id);
|
68 |
+
$_wp_sidebars_widgets['lp_sidebar'] = $active_widgets['lp_sidebar'];
|
69 |
+
update_option('sidebars_widgets', $active_widgets);
|
70 |
+
}
|
71 |
}
|
72 |
|
|
|
|
|
73 |
|
74 |
+
$count = 0;
|
75 |
+
$found = 0;
|
76 |
+
foreach ($_wp_sidebars_widgets as $key => $val) {
|
77 |
+
|
78 |
+
foreach ($whitelist as $item) {
|
79 |
|
80 |
+
if (strpos($key, $item) !== FALSE || $key == 'sidebar') {
|
81 |
+
$_wp_sidebars_widgets['wp_inactive_widgets'] = array();
|
82 |
+
$_wp_sidebars_widgets[$key] = $_wp_sidebars_widgets['lp_sidebar'];
|
83 |
+
$found = 1;
|
84 |
+
}
|
85 |
+
}
|
86 |
+
if (!$found && $count===0) {
|
87 |
$_wp_sidebars_widgets[$key] = $_wp_sidebars_widgets['lp_sidebar'];
|
|
|
88 |
}
|
89 |
+
$count++;
|
90 |
}
|
91 |
|
92 |
+
/* error_log(print_r($wp_registered_widgets,true)); */
|
93 |
+
error_log(print_r($_wp_sidebars_widgets,true));
|
94 |
+
|
95 |
|
96 |
}
|
97 |
}
|
landing-pages.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Landing Pages
|
4 |
Plugin URI: http://www.inboundnow.com/landing-pages/
|
5 |
Description: Landing page template framework with variant testing and lead capturing through cooperation with Inbound Now's Leads plugin. This is the stand alone version served through WordPress.org.
|
6 |
-
Version: 2.4.
|
7 |
Author: Inbound Now
|
8 |
Author URI: http://www.inboundnow.com/
|
9 |
|
@@ -37,7 +37,7 @@ if (!class_exists('Inbound_Landing_Pages_Plugin')) {
|
|
37 |
*/
|
38 |
private static function load_constants() {
|
39 |
|
40 |
-
define('LANDINGPAGES_CURRENT_VERSION', '2.4.
|
41 |
define('LANDINGPAGES_URLPATH', plugins_url( '/' , __FILE__ ) );
|
42 |
define('LANDINGPAGES_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
|
43 |
define('LANDINGPAGES_PLUGIN_SLUG', 'landing-pages' );
|
3 |
Plugin Name: Landing Pages
|
4 |
Plugin URI: http://www.inboundnow.com/landing-pages/
|
5 |
Description: Landing page template framework with variant testing and lead capturing through cooperation with Inbound Now's Leads plugin. This is the stand alone version served through WordPress.org.
|
6 |
+
Version: 2.4.6
|
7 |
Author: Inbound Now
|
8 |
Author URI: http://www.inboundnow.com/
|
9 |
|
37 |
*/
|
38 |
private static function load_constants() {
|
39 |
|
40 |
+
define('LANDINGPAGES_CURRENT_VERSION', '2.4.6' );
|
41 |
define('LANDINGPAGES_URLPATH', plugins_url( '/' , __FILE__ ) );
|
42 |
define('LANDINGPAGES_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
|
43 |
define('LANDINGPAGES_PLUGIN_SLUG', 'landing-pages' );
|
readme.txt
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
=== WordPress Landing Pages ===
|
2 |
|
3 |
-
Contributors: Hudson Atwell, David Wells, Giulio Daprela, ahmedkaludi
|
4 |
Donate link: mailto:hudson@inboundnow.com
|
5 |
License: GPLv2 or later
|
6 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
7 |
Tags: landing pages, inbound marketing, conversion pages, split testing, a b test, a b testing, a/b test, a/b testing, coming soon page, email list, landing page, list building, maintenance page, squeeze page, inbound now, landing-pages, splash pages, cpa, click tracking, goal tracking, analytics, free landing page templates
|
8 |
Requires at least: 3.8
|
9 |
-
Tested up to: 4.7.
|
10 |
-
Stable Tag: 2.4.
|
11 |
|
12 |
Create landing pages for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own templates and more.
|
13 |
|
@@ -15,7 +15,7 @@ Create landing pages for your WordPress site. Monitor and improve conversion rat
|
|
15 |
|
16 |
> WordPress Landing Pages works as a standalone plugin or hand in hand with [WordPress Calls to Action](http://wordpress.org/plugins/cta/ "Learn more about Calls to Action") & [WordPress Leads](http://wordpress.org/plugins/leads/ "Learn more about WordPress Leads") to create a powerful & free lead generation system for your business.
|
17 |
|
18 |
-
This
|
19 |
|
20 |
The landing page plugin was specifically designed with inbound marketing best practices in mind and will help you drive & convert more leads on your site.
|
21 |
|
@@ -63,13 +63,22 @@ The plugin is also fully extendable and has a number of actions, filters, and ho
|
|
63 |
|
64 |
== Screenshots ==
|
65 |
|
66 |
-
1.
|
67 |
-
2.
|
68 |
-
3.
|
69 |
-
4.
|
|
|
|
|
|
|
|
|
70 |
|
71 |
== Changelog ==
|
72 |
|
|
|
|
|
|
|
|
|
|
|
73 |
= 2.4.5 =
|
74 |
* Improving WYSIWYG "Add Media" button support for core templates
|
75 |
* Updating ACF4 to latest version.
|
1 |
=== WordPress Landing Pages ===
|
2 |
|
3 |
+
Contributors: Hudson Atwell, David Wells, Giulio Daprela, Matt Bisset, ahmedkaludi
|
4 |
Donate link: mailto:hudson@inboundnow.com
|
5 |
License: GPLv2 or later
|
6 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
7 |
Tags: landing pages, inbound marketing, conversion pages, split testing, a b test, a b testing, a/b test, a/b testing, coming soon page, email list, landing page, list building, maintenance page, squeeze page, inbound now, landing-pages, splash pages, cpa, click tracking, goal tracking, analytics, free landing page templates
|
8 |
Requires at least: 3.8
|
9 |
+
Tested up to: 4.7.3
|
10 |
+
Stable Tag: 2.4.6
|
11 |
|
12 |
Create landing pages for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own templates and more.
|
13 |
|
15 |
|
16 |
> WordPress Landing Pages works as a standalone plugin or hand in hand with [WordPress Calls to Action](http://wordpress.org/plugins/cta/ "Learn more about Calls to Action") & [WordPress Leads](http://wordpress.org/plugins/leads/ "Learn more about WordPress Leads") to create a powerful & free lead generation system for your business.
|
17 |
|
18 |
+
This framework provides a way to create and develop landing pages for your WordPress site. It's powered by the Advanced Custom Fields framework. It gives site owners the ability to monitor and track conversion rates, run a/b or multivariate split tests on landing pages, and most importantly increase lead flow!
|
19 |
|
20 |
The landing page plugin was specifically designed with inbound marketing best practices in mind and will help you drive & convert more leads on your site.
|
21 |
|
63 |
|
64 |
== Screenshots ==
|
65 |
|
66 |
+
1. Listing created landing pages - Powered by custom post type
|
67 |
+
2. Selecting a template when creating a new landing page
|
68 |
+
3. Editing the landing page. Viewing variation performance
|
69 |
+
4. Viewing setting options for a landing page variation
|
70 |
+
5. Framework is powered by Advanced Custom Fields
|
71 |
+
6. Add custom CSS and custom JS
|
72 |
+
7. Landing page comes with a visual editor
|
73 |
+
8. Administrative popup preview of landing page
|
74 |
|
75 |
== Changelog ==
|
76 |
|
77 |
+
= 2.4.6 =
|
78 |
+
* Improving way we handle the replacement of sidebars when using default template
|
79 |
+
* FireFox support for datetime picker.
|
80 |
+
* Better ACF4 media uploader support for WYSIWG
|
81 |
+
|
82 |
= 2.4.5 =
|
83 |
* Improving WYSIWYG "Add Media" button support for core templates
|
84 |
* Updating ACF4 to latest version.
|
screenshot-1.jpg
DELETED
Binary file
|
screenshot-2.jpg
DELETED
Binary file
|
screenshot-3.jpg
DELETED
Binary file
|
screenshot-4.jpg
DELETED
Binary file
|
shared/classes/class.events.php
CHANGED
@@ -28,9 +28,6 @@ class Inbound_Events {
|
|
28 |
/* create link_tracking table if does not exist */
|
29 |
add_action('inbound_shared_activate' , array( __CLASS__ , 'create_link_tracking_table' ));
|
30 |
|
31 |
-
/* listen for cta clicks and record event to events table */
|
32 |
-
add_action('inbound_tracked_cta_click' , array( __CLASS__ , 'store_cta_click'), 10 , 1);
|
33 |
-
|
34 |
/* listen for Inbound Form submissions and record event to events table */
|
35 |
add_action('inbound_store_lead_post' , array( __CLASS__ , 'store_form_submission'), 10 , 1);
|
36 |
|
@@ -191,15 +188,6 @@ class Inbound_Events {
|
|
191 |
self::store_event($args);
|
192 |
}
|
193 |
|
194 |
-
/**
|
195 |
-
* Stores cta click event into events table
|
196 |
-
* @param $args
|
197 |
-
*/
|
198 |
-
public static function store_cta_click( $args ) {
|
199 |
-
$args['event_name'] = 'inbound_cta_click';
|
200 |
-
self::store_event($args);
|
201 |
-
}
|
202 |
-
|
203 |
|
204 |
/**
|
205 |
* Stores inbound email click event into events table
|
@@ -522,6 +510,11 @@ class Inbound_Events {
|
|
522 |
$title = get_the_title($event['cta_id']);
|
523 |
$capture_id = $event['cta_id'];
|
524 |
break;
|
|
|
|
|
|
|
|
|
|
|
525 |
case 'inbound_form_submission':
|
526 |
$link = admin_url('post.php?post='.$event['form_id'].'&action=edit');
|
527 |
$title = get_the_title($event['form_id']);
|
@@ -948,6 +941,9 @@ class Inbound_Events {
|
|
948 |
case 'inbound_cta_click':
|
949 |
return ($plural) ? __('CTA Clicks' , 'inbound-pro') : __('CTA Click' , 'inbound-pro');
|
950 |
break;
|
|
|
|
|
|
|
951 |
case 'inbound_direct_messege':
|
952 |
return ($plural) ? __('Direct Messages' , 'inbound-pro') : __('Direct Message' , 'inbound-pro');
|
953 |
break;
|
@@ -1092,6 +1088,58 @@ class Inbound_Events {
|
|
1092 |
return $results;
|
1093 |
}
|
1094 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1095 |
/**
|
1096 |
* Get all email click events related to lead ID
|
1097 |
*/
|
28 |
/* create link_tracking table if does not exist */
|
29 |
add_action('inbound_shared_activate' , array( __CLASS__ , 'create_link_tracking_table' ));
|
30 |
|
|
|
|
|
|
|
31 |
/* listen for Inbound Form submissions and record event to events table */
|
32 |
add_action('inbound_store_lead_post' , array( __CLASS__ , 'store_form_submission'), 10 , 1);
|
33 |
|
188 |
self::store_event($args);
|
189 |
}
|
190 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
|
192 |
/**
|
193 |
* Stores inbound email click event into events table
|
510 |
$title = get_the_title($event['cta_id']);
|
511 |
$capture_id = $event['cta_id'];
|
512 |
break;
|
513 |
+
case 'inbound_content_click':
|
514 |
+
$link = admin_url('post.php?post='.$event['page_id'].'&action=edit');
|
515 |
+
$title = get_the_title($event['page_id']);
|
516 |
+
$capture_id = $event['page_id'];
|
517 |
+
break;
|
518 |
case 'inbound_form_submission':
|
519 |
$link = admin_url('post.php?post='.$event['form_id'].'&action=edit');
|
520 |
$title = get_the_title($event['form_id']);
|
941 |
case 'inbound_cta_click':
|
942 |
return ($plural) ? __('CTA Clicks' , 'inbound-pro') : __('CTA Click' , 'inbound-pro');
|
943 |
break;
|
944 |
+
case 'inbound_content_click':
|
945 |
+
return ($plural) ? __('Content Clicks' , 'inbound-pro') : __('Content Click' , 'inbound-pro');
|
946 |
+
break;
|
947 |
case 'inbound_direct_messege':
|
948 |
return ($plural) ? __('Direct Messages' , 'inbound-pro') : __('Direct Message' , 'inbound-pro');
|
949 |
break;
|
1088 |
return $results;
|
1089 |
}
|
1090 |
|
1091 |
+
/**
|
1092 |
+
* Get all cta click events related to lead ID
|
1093 |
+
*/
|
1094 |
+
public static function get_content_clicks( $lead_id ){
|
1095 |
+
global $wpdb;
|
1096 |
+
|
1097 |
+
$table_name = $wpdb->prefix . "inbound_events";
|
1098 |
+
|
1099 |
+
$query = 'SELECT * FROM '.$table_name.' WHERE `lead_id` = "'.$lead_id.'" AND `event_name` = "inbound_content_click" ORDER BY `datetime` DESC';
|
1100 |
+
$results = $wpdb->get_results( $query , ARRAY_A );
|
1101 |
+
|
1102 |
+
return $results;
|
1103 |
+
}
|
1104 |
+
|
1105 |
+
/**
|
1106 |
+
* Get cta click events given conditions
|
1107 |
+
*
|
1108 |
+
*/
|
1109 |
+
public static function get_content_clicks_by( $nature = 'lead_id' , $params ){
|
1110 |
+
global $wpdb;
|
1111 |
+
|
1112 |
+
$table_name = $wpdb->prefix . "inbound_events";
|
1113 |
+
$query = 'SELECT * FROM '.$table_name.' WHERE ';
|
1114 |
+
|
1115 |
+
switch ($nature) {
|
1116 |
+
case 'lead_id':
|
1117 |
+
$query .= '`lead_id` = "'.$params['lead_id'].'" ';
|
1118 |
+
break;
|
1119 |
+
case 'page_id':
|
1120 |
+
$query .= '`page_id` = "'.$params['page_id'].'" ';
|
1121 |
+
break;
|
1122 |
+
case 'cta_id':
|
1123 |
+
$query .= '`cta_id` = "'.$params['cta_id'].'" ';
|
1124 |
+
break;
|
1125 |
+
}
|
1126 |
+
|
1127 |
+
/* add date constraints if applicable */
|
1128 |
+
if (isset($params['start_date'])) {
|
1129 |
+
$query .= 'AND datetime >= "'.$params['start_date'].'" AND datetime <= "'.$params['end_date'].'" ';
|
1130 |
+
}
|
1131 |
+
|
1132 |
+
if (isset($params['variation_id'])) {
|
1133 |
+
$query .= 'AND variation_id = "'.$params['variation_id'].'" ';
|
1134 |
+
}
|
1135 |
+
|
1136 |
+
$query .= 'AND `event_name` = "inbound_cta_click" ORDER BY `datetime` DESC';
|
1137 |
+
|
1138 |
+
$results = $wpdb->get_results( $query , ARRAY_A );
|
1139 |
+
|
1140 |
+
return $results;
|
1141 |
+
}
|
1142 |
+
|
1143 |
/**
|
1144 |
* Get all email click events related to lead ID
|
1145 |
*/
|
shared/classes/class.form.php
CHANGED
@@ -41,6 +41,7 @@ if (!class_exists('Inbound_Forms')) {
|
|
41 |
'redirect' => '',
|
42 |
'icon' => '',
|
43 |
'lists' => '',
|
|
|
44 |
'submit' => 'Submit',
|
45 |
'submit_colors' => '',
|
46 |
'submit_text_color' => '',
|
@@ -292,6 +293,15 @@ if (!class_exists('Inbound_Forms')) {
|
|
292 |
}
|
293 |
|
294 |
$form .= '<input class="inbound-input inbound-input-text ' . $formatted_label . $input_classes . ' ' . $field_input_class . '" name="' . $field_name . '" ' . $form_placeholder . ' id="' . $field_name . '" value="' . $fill_value . '" type="' . $type . '"' . $data_mapping_attr . $et_output . ' ' . $req . '/>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
295 |
|
296 |
} else if ($type === 'time') {
|
297 |
|
@@ -465,7 +475,17 @@ if (!class_exists('Inbound_Forms')) {
|
|
465 |
$form .= '<div class="inbound-field ' . $main_layout . ' inbound-submit-area"><button type="submit" class="inbound-button-submit inbound-submit-action" value="' . $submit_button . '" name="send" id="inbound_form_submit" data-ignore-form-field="true" style="' . $submit_bg . $submit_color . $image_button . 'position:relative;">' . $icon_insert . '' . $submit_button . $inner_button . '</button></div><input data-ignore-form-field="true" type="hidden" name="inbound_submitted" value="1">';
|
466 |
/* <!--<input type="submit" '.$submit_button_type.' class="button" value="'.$submit_button.'" name="send" id="inbound_form_submit" />--> */
|
467 |
|
468 |
-
$form .= '<input type="hidden" name="inbound_form_n" class="inbound_form_n" value="' . $form_name . '"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
469 |
$form .= "<style type='text/css'>.inbound-button-submit{ {$font_size} }</style>";
|
470 |
$form = preg_replace('/<br class="inbr".\/>/', '', $form); /* remove editor br tags */
|
471 |
|
41 |
'redirect' => '',
|
42 |
'icon' => '',
|
43 |
'lists' => '',
|
44 |
+
'tags' => '',
|
45 |
'submit' => 'Submit',
|
46 |
'submit_colors' => '',
|
47 |
'submit_text_color' => '',
|
293 |
}
|
294 |
|
295 |
$form .= '<input class="inbound-input inbound-input-text ' . $formatted_label . $input_classes . ' ' . $field_input_class . '" name="' . $field_name . '" ' . $form_placeholder . ' id="' . $field_name . '" value="' . $fill_value . '" type="' . $type . '"' . $data_mapping_attr . $et_output . ' ' . $req . '/>';
|
296 |
+
$form .= ' <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
|
297 |
+
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
|
298 |
+
<script>
|
299 |
+
jQuery(function(){
|
300 |
+
if( navigator.userAgent.toLowerCase().indexOf(\'firefox\') > -1) {
|
301 |
+
jQuery(\'input[type="date"]\').datepicker( {dateFormat: "mm-dd-yy" } );
|
302 |
+
}
|
303 |
+
});
|
304 |
+
</script>';
|
305 |
|
306 |
} else if ($type === 'time') {
|
307 |
|
475 |
$form .= '<div class="inbound-field ' . $main_layout . ' inbound-submit-area"><button type="submit" class="inbound-button-submit inbound-submit-action" value="' . $submit_button . '" name="send" id="inbound_form_submit" data-ignore-form-field="true" style="' . $submit_bg . $submit_color . $image_button . 'position:relative;">' . $icon_insert . '' . $submit_button . $inner_button . '</button></div><input data-ignore-form-field="true" type="hidden" name="inbound_submitted" value="1">';
|
476 |
/* <!--<input type="submit" '.$submit_button_type.' class="button" value="'.$submit_button.'" name="send" id="inbound_form_submit" />--> */
|
477 |
|
478 |
+
$form .= '<input type="hidden" name="inbound_form_n" class="inbound_form_n" value="' . $form_name . '">';
|
479 |
+
$form .= '<input type="hidden" name="inbound_form_lists" id="inbound_form_lists" value="' . $lists . '" data-map-form-field="inbound_form_lists">';
|
480 |
+
$form .= '<input type="hidden" name="inbound_form_tags" id="inbound_form_tags" value="' . $tags . '" data-map-form-field="inbound_form_tags">';
|
481 |
+
$form .= '<input type="hidden" name="inbound_form_id" class="inbound_form_id" value="' . $id . '">';
|
482 |
+
$form .= '<input type="hidden" name="inbound_current_page_url" value="' . $current_page . '">';
|
483 |
+
$form .= '<input type="hidden" name="page_id" value="' . (isset($post->ID) ? $post->ID : '0') . '">';
|
484 |
+
$form .= '<input type="hidden" name="inbound_furl" value="' . base64_encode(trim($redirect)) . '">';
|
485 |
+
$form .= '<input type="hidden" name="inbound_notify" value="' . base64_encode($notify) . '">';
|
486 |
+
$form .= '<input type="hidden" class="inbound_params" name="inbound_params" value="">';
|
487 |
+
$form .= '</div>';
|
488 |
+
$form .= '</form>';
|
489 |
$form .= "<style type='text/css'>.inbound-button-submit{ {$font_size} }</style>";
|
490 |
$form = preg_replace('/<br class="inbr".\/>/', '', $form); /* remove editor br tags */
|
491 |
|
shared/classes/class.inbound-api.php
CHANGED
@@ -933,6 +933,13 @@ if (!class_exists('Inbound_API')) {
|
|
933 |
self::throw_wp_error( $lead_id );
|
934 |
}
|
935 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
936 |
/* Add meta data to lead record */
|
937 |
foreach ($params['meta_data'] as $key => $value ) {
|
938 |
update_post_meta( $lead_id, $key, $value );
|
@@ -1265,12 +1272,10 @@ if (!class_exists('Inbound_API')) {
|
|
1265 |
|
1266 |
$table_name = $wpdb->prefix . "inbound_tracked_links";
|
1267 |
|
1268 |
-
/*
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
return get_site_url( get_current_blog_id(), self::$tracking_endpoint . '/' . $results[0]['token'] );
|
1273 |
-
}
|
1274 |
}
|
1275 |
|
1276 |
$token = self::generate_token();
|
@@ -1296,8 +1301,8 @@ if (!class_exists('Inbound_API')) {
|
|
1296 |
$params = array_merge( $params, $_REQUEST );
|
1297 |
|
1298 |
/* lead email or lead id required */
|
1299 |
-
if ( !isset( $params['id'] ) && !isset( $params['email_id']) && !isset( $params['cta_id']) ) {
|
1300 |
-
$error['error'] = __( 'This endpoint requires either the \'id\' or the \'email\' or the \'cta_id\' parameter be set.', 'inbound-pro' ) ;
|
1301 |
self::$data = $error;
|
1302 |
self::output( 401 );
|
1303 |
}
|
@@ -1329,15 +1334,6 @@ if (!class_exists('Inbound_API')) {
|
|
1329 |
$args = array_merge( $args, $params['custom_data'] );
|
1330 |
}
|
1331 |
|
1332 |
-
/* Set datetime */
|
1333 |
-
if (!isset($args['cta_id'])) {
|
1334 |
-
$args['datetime'] = current_time('mysql');
|
1335 |
-
}
|
1336 |
-
|
1337 |
-
/* if lead_id is not set then set */
|
1338 |
-
if (!isset($args['lead_id'])) {
|
1339 |
-
$args['lead_id'] = $args['id'];
|
1340 |
-
}
|
1341 |
|
1342 |
/* get tracked link */
|
1343 |
$tracked_link = self::analytics_get_tracking_code( $args );
|
@@ -1380,9 +1376,20 @@ if (!class_exists('Inbound_API')) {
|
|
1380 |
$profile = $profiles[0];
|
1381 |
$args = unserialize($profile->args);
|
1382 |
|
|
|
1383 |
$lead_id_cookie = (isset($_COOKIE['wp_lead_id'])) ? $_COOKIE['wp_lead_id'] : 0;
|
|
|
|
|
|
|
|
|
|
|
1384 |
$args['id'] = (isset( $args['id']) && $args['id'] ) ? $args['id'] : $lead_id_cookie;
|
1385 |
|
|
|
|
|
|
|
|
|
|
|
1386 |
/* process extra lead events */
|
1387 |
if ($args['id']) {
|
1388 |
/* Add lead to lists */
|
933 |
self::throw_wp_error( $lead_id );
|
934 |
}
|
935 |
|
936 |
+
/* determine last name from first name */
|
937 |
+
if (isset($params['meta_data']['wpleads_first_name']) && !isset($params['meta_data']['wpleads_last_name'])) {
|
938 |
+
$split = explode(' ' , $params['meta_data']['wpleads_first_name']);
|
939 |
+
$params['meta_data']['wpleads_first_name'] = ($split[0]) ? $split[0] : $params['meta_data']['wpleads_first_name'];
|
940 |
+
$params['meta_data']['wpleads_last_name'] = (isset($split[1])) ? $split[1] : '';
|
941 |
+
}
|
942 |
+
|
943 |
/* Add meta data to lead record */
|
944 |
foreach ($params['meta_data'] as $key => $value ) {
|
945 |
update_post_meta( $lead_id, $key, $value );
|
1272 |
|
1273 |
$table_name = $wpdb->prefix . "inbound_tracked_links";
|
1274 |
|
1275 |
+
/* check args to see if token already exists */
|
1276 |
+
$results = $wpdb->get_results("SELECT * FROM $table_name WHERE args = '".serialize( $args )."' LIMIT 1", ARRAY_A );
|
1277 |
+
if ($results) {
|
1278 |
+
return get_site_url( get_current_blog_id(), self::$tracking_endpoint . '/' . $results[0]['token'] );
|
|
|
|
|
1279 |
}
|
1280 |
|
1281 |
$token = self::generate_token();
|
1301 |
$params = array_merge( $params, $_REQUEST );
|
1302 |
|
1303 |
/* lead email or lead id required */
|
1304 |
+
if ( !isset( $params['id'] ) && !isset( $params['email_id']) && !isset( $params['cta_id']) && !isset( $params['page_id']) ) {
|
1305 |
+
$error['error'] = __( 'This endpoint requires either the \'id\' or the \'email\' or the \'cta_id\'or the \'page_id\' parameter be set.', 'inbound-pro' ) ;
|
1306 |
self::$data = $error;
|
1307 |
self::output( 401 );
|
1308 |
}
|
1334 |
$args = array_merge( $args, $params['custom_data'] );
|
1335 |
}
|
1336 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1337 |
|
1338 |
/* get tracked link */
|
1339 |
$tracked_link = self::analytics_get_tracking_code( $args );
|
1376 |
$profile = $profiles[0];
|
1377 |
$args = unserialize($profile->args);
|
1378 |
|
1379 |
+
/* get lead id from cookie if it exists */
|
1380 |
$lead_id_cookie = (isset($_COOKIE['wp_lead_id'])) ? $_COOKIE['wp_lead_id'] : 0;
|
1381 |
+
|
1382 |
+
/* if lead_id is set then apply it to 'id' */
|
1383 |
+
$args['id'] = (isset( $args['lead_id'] ) && $args['lead_id']) ? $args['lead_id'] : $args['id'];
|
1384 |
+
|
1385 |
+
/* if no lead_id so far then fall back on cookie value */
|
1386 |
$args['id'] = (isset( $args['id']) && $args['id'] ) ? $args['id'] : $lead_id_cookie;
|
1387 |
|
1388 |
+
/* cookie lead id if availabled and not cookied */
|
1389 |
+
if (!isset($_COOKIE['wp_lead_id']) && $args['id'] ) {
|
1390 |
+
setcookie('wp_lead_id' , $args['id'] , time() + (20 * 365 * 24 * 60 * 60), '/' );
|
1391 |
+
}
|
1392 |
+
|
1393 |
/* process extra lead events */
|
1394 |
if ($args['id']) {
|
1395 |
/* Add lead to lists */
|
shared/classes/class.lead-fields.php
CHANGED
@@ -289,7 +289,7 @@ if ( !class_exists('Leads_Field_Map') ) {
|
|
289 |
$lead_fields = Leads_Field_Map::prioritize_lead_fields( $lead_fields );
|
290 |
|
291 |
$field_map = array();
|
292 |
-
$field_map[''] = '
|
293 |
foreach ($lead_fields as $key=>$field) {
|
294 |
if (!isset($field['key'])) {
|
295 |
continue;
|
289 |
$lead_fields = Leads_Field_Map::prioritize_lead_fields( $lead_fields );
|
290 |
|
291 |
$field_map = array();
|
292 |
+
$field_map[''] = __('Not set.','inbound-pro'); /* default empty */
|
293 |
foreach ($lead_fields as $key=>$field) {
|
294 |
if (!isset($field['key'])) {
|
295 |
continue;
|
shared/classes/class.lead-storage.php
CHANGED
@@ -100,6 +100,13 @@ if (!class_exists('LeadStorage')) {
|
|
100 |
$lead['lead_lists'] = explode(",", $mappedData['inbound_form_lists']);
|
101 |
}
|
102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
/* Look for direct key matches & clean up $lead_data */
|
104 |
$lead = apply_filters( 'inboundnow_store_lead_pre_filter_data', $lead, $args);
|
105 |
|
@@ -130,7 +137,7 @@ if (!class_exists('LeadStorage')) {
|
|
130 |
if(!empty($lead['lead_lists']) && is_array($lead['lead_lists'])){
|
131 |
$double_optin_lists = array();
|
132 |
$normal_lists = array();
|
133 |
-
|
134 |
/*differentiate between double optin lists and lists that don't require double optin*/
|
135 |
foreach($lead['lead_lists'] as $list_id){
|
136 |
$list_meta_settings = get_term_meta($list_id, 'wplead_lead_list_meta_settings', true);
|
@@ -140,48 +147,61 @@ if (!class_exists('LeadStorage')) {
|
|
140 |
$normal_lists[] = $list_id;
|
141 |
}
|
142 |
}
|
143 |
-
|
144 |
-
/*remove any groups that the lead is already on from the double optin groups*/
|
145 |
-
if(array_filter($double_optin_lists)){
|
146 |
-
$existing_lists = wp_get_post_terms( $lead['id'], 'wplead_list_category');
|
147 |
-
foreach($existing_lists as $existing_list){
|
148 |
-
if(in_array($existing_list->term_id, $double_optin_lists)){
|
149 |
-
$index = array_search($existing_list->term_id, $double_optin_lists);
|
150 |
-
unset($double_optin_lists[$index]);
|
151 |
-
}
|
152 |
-
}
|
153 |
-
}
|
154 |
|
|
|
155 |
if(array_filter($double_optin_lists)){
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
/*if there is a list to store the leads in*/
|
165 |
-
if($double_optin_list_id){
|
166 |
-
/*store the list ids that need confirmation*/
|
167 |
-
update_post_meta($lead['id'], 'double_optin_lists', $double_optin_lists);
|
168 |
-
|
169 |
-
/*change the lead status to waiting for double optin*/
|
170 |
-
update_post_meta( $lead['id'] , 'wp_lead_status' , 'double-optin');
|
171 |
-
|
172 |
-
|
173 |
-
/*add the lead to the double optin confirmation list*/
|
174 |
-
Inbound_Leads::add_lead_to_list($lead['id'], $double_optin_list_id);
|
175 |
-
Inbound_List_Double_Optin::send_double_optin_confirmation($lead);
|
176 |
-
}
|
177 |
}
|
178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
/*add the lead to all lists that don't require double optin*/
|
180 |
Inbound_Leads::add_lead_to_list($lead['id'], $normal_lists);
|
181 |
|
182 |
/* store lead list cookie */
|
183 |
if (class_exists('Leads_Tracking')) {
|
184 |
-
Leads_Tracking::cookie_lead_lists($lead['id']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
}
|
186 |
}
|
187 |
|
@@ -472,10 +492,6 @@ if (!class_exists('LeadStorage')) {
|
|
472 |
'lead_id' => $lead['id'],
|
473 |
);
|
474 |
|
475 |
-
$array = array(
|
476 |
-
'lead_id' => 0,
|
477 |
-
'lead_uid' => (isset($lead['wp_lead_uid'])) ? $lead['wp_lead_uid'] : $lead_uid_cookie
|
478 |
-
);
|
479 |
|
480 |
/* update inbound_page_view page view records associated with lead */
|
481 |
$wpdb->update(
|
@@ -487,7 +503,7 @@ if (!class_exists('LeadStorage')) {
|
|
487 |
),
|
488 |
array(
|
489 |
'%d',
|
490 |
-
'%
|
491 |
)
|
492 |
);
|
493 |
}
|
@@ -497,18 +513,13 @@ if (!class_exists('LeadStorage')) {
|
|
497 |
*/
|
498 |
public static function update_events( $lead ) {
|
499 |
global $wpdb;
|
500 |
-
|
501 |
$table_name = $wpdb->prefix . "inbound_events";
|
502 |
$lead_uid_cookie = (isset($_COOKIE["wp_lead_uid"])) ? $_COOKIE["wp_lead_uid"] : '';
|
|
|
503 |
$args = array(
|
504 |
'lead_id' => $lead['id'],
|
505 |
);
|
506 |
|
507 |
-
$array = array(
|
508 |
-
'lead_id' => 0,
|
509 |
-
'lead_uid' => (isset($lead['wp_lead_uid'])) ? $lead['wp_lead_uid'] : $lead_uid_cookie
|
510 |
-
);
|
511 |
-
|
512 |
/* update inbound_page_view page view records associated with lead */
|
513 |
$wpdb->update(
|
514 |
$table_name,
|
@@ -519,7 +530,7 @@ if (!class_exists('LeadStorage')) {
|
|
519 |
),
|
520 |
array(
|
521 |
'%d',
|
522 |
-
'%
|
523 |
)
|
524 |
);
|
525 |
}
|
100 |
$lead['lead_lists'] = explode(",", $mappedData['inbound_form_lists']);
|
101 |
}
|
102 |
|
103 |
+
/* prepate lead tags */
|
104 |
+
$lead['lead_tags'] = (isset($args['lead_tags'])) ? $args['lead_tags'] : null;
|
105 |
+
if ( !$lead['lead_tags'] && array_key_exists('inbound_form_tags', $mappedData) ) {
|
106 |
+
$lead['lead_tags'] = explode(",", $mappedData['inbound_form_tags']);
|
107 |
+
}
|
108 |
+
|
109 |
+
|
110 |
/* Look for direct key matches & clean up $lead_data */
|
111 |
$lead = apply_filters( 'inboundnow_store_lead_pre_filter_data', $lead, $args);
|
112 |
|
137 |
if(!empty($lead['lead_lists']) && is_array($lead['lead_lists'])){
|
138 |
$double_optin_lists = array();
|
139 |
$normal_lists = array();
|
140 |
+
|
141 |
/*differentiate between double optin lists and lists that don't require double optin*/
|
142 |
foreach($lead['lead_lists'] as $list_id){
|
143 |
$list_meta_settings = get_term_meta($list_id, 'wplead_lead_list_meta_settings', true);
|
147 |
$normal_lists[] = $list_id;
|
148 |
}
|
149 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
|
151 |
+
/*remove any groups that the lead is already on from the double optin groups*/
|
152 |
if(array_filter($double_optin_lists)){
|
153 |
+
$existing_lists = wp_get_post_terms( $lead['id'], 'wplead_list_category');
|
154 |
+
foreach($existing_lists as $existing_list){
|
155 |
+
if(in_array($existing_list->term_id, $double_optin_lists)){
|
156 |
+
$index = array_search($existing_list->term_id, $double_optin_lists);
|
157 |
+
unset($double_optin_lists[$index]);
|
158 |
+
}
|
159 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
}
|
161 |
+
|
162 |
+
if(array_filter($double_optin_lists)){
|
163 |
+
/*get the double optin waiting list id*/
|
164 |
+
if(!defined('INBOUND_PRO_CURRENT_VERSION')){
|
165 |
+
$double_optin_list_id = get_option('list-double-optin-list-id', '');
|
166 |
+
}else{
|
167 |
+
$settings = Inbound_Options_API::get_option('inbound-pro', 'settings', array());
|
168 |
+
$double_optin_list_id = $settings['leads']['list-double-optin-list-id'];
|
169 |
+
}
|
170 |
+
|
171 |
+
/*if there is a list to store the leads in*/
|
172 |
+
if($double_optin_list_id){
|
173 |
+
/*store the list ids that need confirmation*/
|
174 |
+
update_post_meta($lead['id'], 'double_optin_lists', $double_optin_lists);
|
175 |
+
|
176 |
+
/*change the lead status to waiting for double optin*/
|
177 |
+
update_post_meta( $lead['id'] , 'wp_lead_status' , 'double-optin');
|
178 |
+
|
179 |
+
/*add the lead to the double optin confirmation list*/
|
180 |
+
Inbound_Leads::add_lead_to_list($lead['id'], $double_optin_list_id);
|
181 |
+
Inbound_List_Double_Optin::send_double_optin_confirmation($lead);
|
182 |
+
}
|
183 |
+
}
|
184 |
+
|
185 |
/*add the lead to all lists that don't require double optin*/
|
186 |
Inbound_Leads::add_lead_to_list($lead['id'], $normal_lists);
|
187 |
|
188 |
/* store lead list cookie */
|
189 |
if (class_exists('Leads_Tracking')) {
|
190 |
+
Leads_Tracking::cookie_lead_lists($lead['id'] , $normal_lists);
|
191 |
+
}
|
192 |
+
}
|
193 |
+
|
194 |
+
/* Add Leads to List on creation */
|
195 |
+
if(!empty($lead['lead_tags']) && is_array($lead['lead_tags'])){
|
196 |
+
|
197 |
+
/*add the lead to all lists that don't require double optin*/
|
198 |
+
foreach ( $lead['lead_tags'] as $tag_id ) {
|
199 |
+
Inbound_Leads::add_tag_to_lead( $lead['id'] , intval($tag_id) );
|
200 |
+
}
|
201 |
+
|
202 |
+
/* store lead list cookie */
|
203 |
+
if (class_exists('Leads_Tracking')) {
|
204 |
+
Leads_Tracking::cookie_lead_tags($lead['id'] , $lead['lead_tags']);
|
205 |
}
|
206 |
}
|
207 |
|
492 |
'lead_id' => $lead['id'],
|
493 |
);
|
494 |
|
|
|
|
|
|
|
|
|
495 |
|
496 |
/* update inbound_page_view page view records associated with lead */
|
497 |
$wpdb->update(
|
503 |
),
|
504 |
array(
|
505 |
'%d',
|
506 |
+
'%s'
|
507 |
)
|
508 |
);
|
509 |
}
|
513 |
*/
|
514 |
public static function update_events( $lead ) {
|
515 |
global $wpdb;
|
|
|
516 |
$table_name = $wpdb->prefix . "inbound_events";
|
517 |
$lead_uid_cookie = (isset($_COOKIE["wp_lead_uid"])) ? $_COOKIE["wp_lead_uid"] : '';
|
518 |
+
|
519 |
$args = array(
|
520 |
'lead_id' => $lead['id'],
|
521 |
);
|
522 |
|
|
|
|
|
|
|
|
|
|
|
523 |
/* update inbound_page_view page view records associated with lead */
|
524 |
$wpdb->update(
|
525 |
$table_name,
|
530 |
),
|
531 |
array(
|
532 |
'%d',
|
533 |
+
'%s'
|
534 |
)
|
535 |
);
|
536 |
}
|
shared/classes/class.load-assets.php
ADDED
@@ -0,0 +1,218 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Inbound Scripts and CSS Enqueue
|
4 |
+
*/
|
5 |
+
|
6 |
+
if (!class_exists('Inbound_Asset_Loader')) {
|
7 |
+
class Inbound_Asset_Loader {
|
8 |
+
static $load_assets;
|
9 |
+
|
10 |
+
static function load_inbound_assets() {
|
11 |
+
self::$load_assets = true;
|
12 |
+
add_action('admin_enqueue_scripts', array(__CLASS__, 'load_admin_scripts'), 101);
|
13 |
+
add_action('wp_enqueue_scripts', array(__CLASS__, 'register_scripts_and_styles'), 101);
|
14 |
+
}
|
15 |
+
|
16 |
+
static function load_admin_scripts(){
|
17 |
+
|
18 |
+
wp_enqueue_style('inbound-global-styles', INBOUNDNOW_SHARED_URLPATH . 'assets/css/admin/global-inbound-admin.css');
|
19 |
+
wp_enqueue_style('inbound-global-css', INBOUNDNOW_SHARED_URLPATH . 'assets/css/global-admin.css');
|
20 |
+
wp_enqueue_style('inbound-metaboxes', INBOUNDNOW_SHARED_URLPATH . 'assets/css/admin/inbound-metaboxes.css');
|
21 |
+
|
22 |
+
$screen = get_current_screen();
|
23 |
+
|
24 |
+
self::enqueue_shared_file('jquery-cookie', 'assets/js/global/jquery.cookie.js', array( 'jquery' ) );
|
25 |
+
self::enqueue_shared_file('jquery-total-storage', 'assets/js/global/jquery.total-storage.min.js', array( 'jquery' ));
|
26 |
+
|
27 |
+
if ( isset($screen) && $screen->id == 'wp-call-to-action') {
|
28 |
+
self::enqueue_shared_file('image-picker-js', 'assets/js/admin/image-picker.js');
|
29 |
+
self::enqueue_shared_file('image-picker-css', 'assets/css/admin/image-picker.css');
|
30 |
+
}
|
31 |
+
|
32 |
+
|
33 |
+
if ( isset($screen) && $screen->base == 'post') {
|
34 |
+
wp_enqueue_script('inbound-editor-js', INBOUNDNOW_SHARED_URLPATH . 'assets/js/admin/editor.js' , array() , null , true );
|
35 |
+
}
|
36 |
+
|
37 |
+
}
|
38 |
+
/**
|
39 |
+
* Registers enqueues
|
40 |
+
*
|
41 |
+
* Example:
|
42 |
+
* self::enqueue_shared_file('SCRIPT-ID', INBOUNDNOW_SHARED_PATH . 'assets/js/frontend/path-in-shared-assets.js', 'localized_var_name', $localized_array_values, $dependancies_array );
|
43 |
+
*/
|
44 |
+
static function register_scripts_and_styles() {
|
45 |
+
global $post;
|
46 |
+
|
47 |
+
global $wp_scripts;
|
48 |
+
$store = false;
|
49 |
+
|
50 |
+
/*
|
51 |
+
if ( !empty( $wp_scripts->queue ) ) {
|
52 |
+
$store = $wp_scripts->queue;
|
53 |
+
foreach ( $wp_scripts->queue as $handle ) {
|
54 |
+
wp_dequeue_script( $handle );
|
55 |
+
}
|
56 |
+
}
|
57 |
+
*/
|
58 |
+
|
59 |
+
/* unminified source available */
|
60 |
+
self::enqueue_shared_file('inbound-analytics', 'assets/js/frontend/analytics/inboundAnalytics.min.js', array( 'jquery' ), 'inbound_settings', self::localize_lead_data() , false);
|
61 |
+
|
62 |
+
if (is_array($store)) {
|
63 |
+
foreach ( $store as $handle ) {
|
64 |
+
wp_enqueue_script( $handle );
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Helper function for registering and enqueueing scripts and styles.
|
72 |
+
*
|
73 |
+
* @name The ID to register with WordPress
|
74 |
+
* @file_path The path to the actual file inside /shared/assets/
|
75 |
+
* @localize_array Optional argument for the localized array
|
76 |
+
* @deps js dependancies by name example 'jquery'
|
77 |
+
* @localize_var the localized variable name
|
78 |
+
*/
|
79 |
+
static function enqueue_shared_file($name, $path, $deps = array(), $localize_var = null, $localize_array = array() , $in_footer = true ) {
|
80 |
+
$is_script = false;
|
81 |
+
$deps = (empty($deps)) ? array() : $deps;
|
82 |
+
$url = INBOUNDNOW_SHARED_URLPATH . $path;
|
83 |
+
$file = INBOUNDNOW_SHARED_PATH . $path;
|
84 |
+
|
85 |
+
$file_type = strpos($path, '.js');
|
86 |
+
if (!(false === $file_type)) { $is_script = true; }
|
87 |
+
|
88 |
+
if(file_exists($file)) {
|
89 |
+
if($is_script) {
|
90 |
+
|
91 |
+
wp_register_script($name, $url, $deps , null , $in_footer );
|
92 |
+
wp_enqueue_script($name);
|
93 |
+
|
94 |
+
if ($localize_var != null) {
|
95 |
+
wp_localize_script( $name , $localize_var, $localize_array );
|
96 |
+
}
|
97 |
+
} else {
|
98 |
+
wp_register_style($name, $url);
|
99 |
+
wp_enqueue_style($name);
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
}
|
104 |
+
|
105 |
+
/* Global Specific localize functions */
|
106 |
+
static function localize_lead_data() {
|
107 |
+
global $post;
|
108 |
+
$post_id = null;
|
109 |
+
$id_check = false;
|
110 |
+
$page_tracking = 'on';
|
111 |
+
$search_tracking = 'on';
|
112 |
+
$comment_tracking = 'on';
|
113 |
+
$post_type = isset($post) ? get_post_type( $post ) : null;
|
114 |
+
$current_page = "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];
|
115 |
+
$ip_address = (isset($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0.0';
|
116 |
+
$lead_id = (isset($_COOKIE['wp_lead_id'])) ? $_COOKIE['wp_lead_id'] : false;
|
117 |
+
$lead_email = (isset($_COOKIE['wp_lead_email'])) ? $_COOKIE['wp_lead_email'] : false;
|
118 |
+
$lead_uid = (isset($_COOKIE['wp_lead_uid'])) ? $_COOKIE['wp_lead_uid'] : false;
|
119 |
+
$custom_map_values = array();
|
120 |
+
$custom_map_values = apply_filters( 'inboundnow_custom_map_values_filter' , $custom_map_values);
|
121 |
+
/* Get correct post ID */
|
122 |
+
|
123 |
+
global $wp_query;
|
124 |
+
$current_page_id = $wp_query->get_queried_object_id();
|
125 |
+
$post_id = $current_page_id;
|
126 |
+
$id_check = ($post_id != null) ? true : false;
|
127 |
+
|
128 |
+
if (!is_archive() && !$id_check){
|
129 |
+
$post_id = (isset($post)) ? $post->ID : false;
|
130 |
+
$id_check = ($post_id != null) ? true : false;
|
131 |
+
}
|
132 |
+
if (!$id_check) {
|
133 |
+
$post_id = wpl_url_to_postid($current_page);
|
134 |
+
$id_check = ($post_id != null) ? true : false;
|
135 |
+
}
|
136 |
+
if(!$id_check){
|
137 |
+
$post_id = wp_leads_get_page_final_id();
|
138 |
+
$id_check = ($post_id != null) ? true : false;
|
139 |
+
}
|
140 |
+
|
141 |
+
/* If page tracking on */
|
142 |
+
$lead_page_view_tracking = self::get_lead_setting( 'wpl-main-page-view-tracking', 1);
|
143 |
+
$lead_search_tracking = self::get_lead_setting( 'wpl-main-search-tracking', 1);
|
144 |
+
$lead_comment_tracking = self::get_lead_setting( 'wpl-main-comment-tracking', 1);
|
145 |
+
if (!$lead_search_tracking) {
|
146 |
+
$search_tracking = 'off';
|
147 |
+
}
|
148 |
+
if (!$lead_comment_tracking) {
|
149 |
+
$comment_tracking = 'off';
|
150 |
+
}
|
151 |
+
if (!$lead_page_view_tracking || isset($_GET['inbound-do-not-track']) ) {
|
152 |
+
$page_tracking = 'off';
|
153 |
+
}
|
154 |
+
|
155 |
+
/* Localize lead data */
|
156 |
+
$lead_data_array = array();
|
157 |
+
$lead_data_array['lead_id'] = ($lead_id) ? $lead_id : null;
|
158 |
+
$lead_data_array['lead_email'] = ($lead_email) ? $lead_email : null;
|
159 |
+
$lead_data_array['lead_uid'] = ($lead_uid) ? $lead_uid : null;
|
160 |
+
$time = current_time( 'timestamp', 0 ); /* Current wordpress time from settings */
|
161 |
+
$wordpress_date_time = date("Y/m/d G:i:s", $time);
|
162 |
+
$inbound_track_include = self::get_lead_setting( 'wpl-main-tracking-ids' , '');
|
163 |
+
$inbound_track_exclude = self::get_lead_setting( 'wpl-main-exclude-tracking-ids' , '');
|
164 |
+
|
165 |
+
/* get variation id */
|
166 |
+
if (class_exists('Landing_Pages_Variations')) {
|
167 |
+
$variation = Landing_Pages_Variations::get_current_variation_id();
|
168 |
+
} else if( function_exists('lp_ab_testing_get_current_variation_id') ) {
|
169 |
+
$variation = lp_ab_testing_get_current_variation_id();
|
170 |
+
}
|
171 |
+
|
172 |
+
$variation = (isset($variation)) ? $variation : 0;
|
173 |
+
|
174 |
+
$inbound_localized_data = array(
|
175 |
+
'post_id' => $post_id,
|
176 |
+
'variation_id' => $variation,
|
177 |
+
'ip_address' => $ip_address,
|
178 |
+
'wp_lead_data' => $lead_data_array,
|
179 |
+
'admin_url' => admin_url('admin-ajax.php'),
|
180 |
+
'track_time' => $wordpress_date_time,
|
181 |
+
'post_type' => $post_type,
|
182 |
+
'page_tracking' => $page_tracking,
|
183 |
+
'search_tracking' => $search_tracking,
|
184 |
+
'comment_tracking' => $comment_tracking,
|
185 |
+
'custom_mapping' => $custom_map_values,
|
186 |
+
'inbound_track_exclude' => $inbound_track_exclude,
|
187 |
+
'inbound_track_include' => $inbound_track_include,
|
188 |
+
'is_admin' => current_user_can( 'manage_options' )
|
189 |
+
);
|
190 |
+
|
191 |
+
return apply_filters( 'inbound_analytics_localized_data' , $inbound_localized_data);
|
192 |
+
} /* end localize lead data */
|
193 |
+
|
194 |
+
/**
|
195 |
+
* Get setting value from DB. Handles stand alone leads plugin differently from Inbound Pro included leads plugin
|
196 |
+
* this function is redundant, but neccecary to prevent fatals when Leads is not activated
|
197 |
+
* @param $field_id
|
198 |
+
* @param $default
|
199 |
+
* @return mixed
|
200 |
+
*/
|
201 |
+
public static function get_lead_setting( $field_id , $default ) {
|
202 |
+
global $inbound_settings;
|
203 |
+
$value = $default;
|
204 |
+
|
205 |
+
if (defined('INBOUND_PRO_CURRENT_VERSION')) {
|
206 |
+
$field_id = str_replace('wpl-main-' , '', $field_id );
|
207 |
+
$value = (isset($inbound_settings['leads'][$field_id])) ? $inbound_settings['leads'][$field_id] : $default;
|
208 |
+
} else {
|
209 |
+
$value = get_option( $field_id, $default );
|
210 |
+
}
|
211 |
+
|
212 |
+
return $value;
|
213 |
+
}
|
214 |
+
|
215 |
+
} /* end class */
|
216 |
+
}
|
217 |
+
|
218 |
+
Inbound_Asset_Loader::load_inbound_assets();
|
shared/classes/class.load-shared.php
CHANGED
@@ -68,7 +68,7 @@ if (!class_exists('Inbound_Load_Shared')) {
|
|
68 |
include_once( INBOUNDNOW_SHARED_PATH . 'classes/class.ajax.php');
|
69 |
include_once( INBOUNDNOW_SHARED_PATH . 'classes/class.inbound-api.php');
|
70 |
include_once( INBOUNDNOW_SHARED_PATH . 'classes/class.inbound-customizer.php');
|
71 |
-
include_once( INBOUNDNOW_SHARED_PATH . '
|
72 |
include_once( INBOUNDNOW_SHARED_PATH . 'shortcodes/inbound-shortcodes.php');
|
73 |
include_once( INBOUNDNOW_SHARED_PATH . 'functions/legacy.php');
|
74 |
include_once( INBOUNDNOW_SHARED_PATH . 'functions/shared.php');
|
68 |
include_once( INBOUNDNOW_SHARED_PATH . 'classes/class.ajax.php');
|
69 |
include_once( INBOUNDNOW_SHARED_PATH . 'classes/class.inbound-api.php');
|
70 |
include_once( INBOUNDNOW_SHARED_PATH . 'classes/class.inbound-customizer.php');
|
71 |
+
include_once( INBOUNDNOW_SHARED_PATH . 'classes/class.load-assets.php');
|
72 |
include_once( INBOUNDNOW_SHARED_PATH . 'shortcodes/inbound-shortcodes.php');
|
73 |
include_once( INBOUNDNOW_SHARED_PATH . 'functions/legacy.php');
|
74 |
include_once( INBOUNDNOW_SHARED_PATH . 'functions/shared.php');
|
shared/classes/class.post-type.wp-lead.php
CHANGED
@@ -714,7 +714,7 @@ if ( !class_exists('Inbound_Leads') ) {
|
|
714 |
if(!defined('INBOUND_PRO_CURRENT_VERSION')){
|
715 |
$double_optin_page_id = get_option('list-double-optin-page-id', '');
|
716 |
}else{
|
717 |
-
$double_optin_page_id = $inbound_settings['leads']['list-double-optin-page-id'];
|
718 |
}
|
719 |
|
720 |
return $double_optin_page_id;
|
714 |
if(!defined('INBOUND_PRO_CURRENT_VERSION')){
|
715 |
$double_optin_page_id = get_option('list-double-optin-page-id', '');
|
716 |
}else{
|
717 |
+
$double_optin_page_id = (isset($inbound_settings['leads']['list-double-optin-page-id'])) ? $inbound_settings['leads']['list-double-optin-page-id'] : '';
|
718 |
}
|
719 |
|
720 |
return $double_optin_page_id;
|
shared/classes/class.shortcodes.email-template.php
CHANGED
@@ -53,11 +53,18 @@ if (!class_exists('Inbound_Email_Template_Shortcodes')) {
|
|
53 |
|
54 |
/* add mapped params */
|
55 |
parse_str($_POST['mapped_params'], $mapped_params);
|
|
|
56 |
|
57 |
foreach ($mapped_params as $key => $value) {
|
58 |
$post_params = array($key => $value) + $post_params;
|
59 |
}
|
60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
/* filter params */
|
62 |
$post_params = apply_filters('inbound_email_response/post_params', $post_params);
|
63 |
|
53 |
|
54 |
/* add mapped params */
|
55 |
parse_str($_POST['mapped_params'], $mapped_params);
|
56 |
+
parse_str($_POST['raw_params'], $raw_params);
|
57 |
|
58 |
foreach ($mapped_params as $key => $value) {
|
59 |
$post_params = array($key => $value) + $post_params;
|
60 |
}
|
61 |
|
62 |
+
foreach ($raw_params as $key => $value) {
|
63 |
+
if (!isset($post_params[$key])) {
|
64 |
+
$post_params = $post_params + array($key => $value);
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
/* filter params */
|
69 |
$post_params = apply_filters('inbound_email_response/post_params', $post_params);
|
70 |
|
shared/shortcodes/css/shortcodes.css
CHANGED
@@ -25,9 +25,12 @@
|
|
25 |
input.short-shortcode-input {
|
26 |
width: 520px;
|
27 |
}
|
28 |
-
.row-class-helper-block label,
|
|
|
|
|
29 |
display: none !important;
|
30 |
}
|
|
|
31 |
.select2-container.inbound-shortcodes-input {
|
32 |
width:100%;
|
33 |
}
|
25 |
input.short-shortcode-input {
|
26 |
width: 520px;
|
27 |
}
|
28 |
+
.row-class-helper-block label,
|
29 |
+
.parent-inbound_shortcode_lists_hidden ,
|
30 |
+
.parent-inbound_shortcode_tags_hidden {
|
31 |
display: none !important;
|
32 |
}
|
33 |
+
|
34 |
.select2-container.inbound-shortcodes-input {
|
35 |
width:100%;
|
36 |
}
|
shared/shortcodes/inbound-shortcodes.php
CHANGED
@@ -152,8 +152,11 @@ class Inbound_Shortcodes {
|
|
152 |
'url' => '',
|
153 |
'target' => ''
|
154 |
), $atts));
|
|
|
|
|
155 |
$style = 'default'; // default setting
|
156 |
-
$class = "inbound-button
|
|
|
157 |
if (preg_match("/#/", $color)){
|
158 |
$color = (isset($color)) ? "background-color: $color;" : '';
|
159 |
} else {
|
152 |
'url' => '',
|
153 |
'target' => ''
|
154 |
), $atts));
|
155 |
+
|
156 |
+
|
157 |
$style = 'default'; // default setting
|
158 |
+
$class = "inbound-button wpl-track-me-link";
|
159 |
+
|
160 |
if (preg_match("/#/", $color)){
|
161 |
$color = (isset($color)) ? "background-color: $color;" : '';
|
162 |
} else {
|
shared/shortcodes/js/shortcodes.js
CHANGED
@@ -52,6 +52,7 @@ var InboundShortcodes = {
|
|
52 |
newoutput = output;
|
53 |
|
54 |
jQuery('.inbound-shortcodes-input').each(function () {
|
|
|
55 |
var input = jQuery(this),
|
56 |
theid = input.attr('id'),
|
57 |
id = theid.replace('inbound_shortcode_', ''),
|
@@ -64,8 +65,6 @@ var InboundShortcodes = {
|
|
64 |
newoutput = newoutput.replace(re, input.val());
|
65 |
}
|
66 |
// Add fix to remove empty params. maybe
|
67 |
-
//console.log(newoutput);
|
68 |
-
|
69 |
});
|
70 |
|
71 |
jQuery('#_inbound_shortcodes_newoutput').remove();
|
@@ -438,15 +437,22 @@ var InboundShortcodes = {
|
|
438 |
placeholder: "Select one or more lists",
|
439 |
|
440 |
});
|
|
|
|
|
|
|
|
|
441 |
|
442 |
|
443 |
jQuery("body").on("inbound_forms_data_ready", function () {
|
444 |
setTimeout(function () {
|
445 |
var fill_list_vals = jQuery("#inbound_shortcode_lists_hidden").val().split(",");
|
446 |
jQuery("#inbound_shortcode_lists").val(fill_list_vals).select2();
|
|
|
|
|
447 |
}, 200);
|
448 |
});
|
449 |
|
|
|
450 |
jQuery("body").on('change', '#inbound_shortcode_lists', function () {
|
451 |
var list_ids = jQuery("#inbound_shortcode_lists").select2("data");
|
452 |
var list_ids_array = new Array();
|
@@ -459,6 +465,20 @@ var InboundShortcodes = {
|
|
459 |
console.log(final_list_ids);
|
460 |
jQuery("#inbound_shortcode_lists_hidden").val(final_list_ids);
|
461 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
462 |
}
|
463 |
|
464 |
if (shortcode_name === 'insert_call_to_action') {
|
52 |
newoutput = output;
|
53 |
|
54 |
jQuery('.inbound-shortcodes-input').each(function () {
|
55 |
+
|
56 |
var input = jQuery(this),
|
57 |
theid = input.attr('id'),
|
58 |
id = theid.replace('inbound_shortcode_', ''),
|
65 |
newoutput = newoutput.replace(re, input.val());
|
66 |
}
|
67 |
// Add fix to remove empty params. maybe
|
|
|
|
|
68 |
});
|
69 |
|
70 |
jQuery('#_inbound_shortcodes_newoutput').remove();
|
437 |
placeholder: "Select one or more lists",
|
438 |
|
439 |
});
|
440 |
+
jQuery("#inbound_shortcode_tags").select2({
|
441 |
+
placeholder: "Select one or more tags",
|
442 |
+
|
443 |
+
});
|
444 |
|
445 |
|
446 |
jQuery("body").on("inbound_forms_data_ready", function () {
|
447 |
setTimeout(function () {
|
448 |
var fill_list_vals = jQuery("#inbound_shortcode_lists_hidden").val().split(",");
|
449 |
jQuery("#inbound_shortcode_lists").val(fill_list_vals).select2();
|
450 |
+
var fill_tag_vals = jQuery("#inbound_shortcode_tags_hidden").val().split(",");
|
451 |
+
jQuery("#inbound_shortcode_tags").val(fill_tag_vals).select2();
|
452 |
}, 200);
|
453 |
});
|
454 |
|
455 |
+
/* add selected lists to hidden fields */
|
456 |
jQuery("body").on('change', '#inbound_shortcode_lists', function () {
|
457 |
var list_ids = jQuery("#inbound_shortcode_lists").select2("data");
|
458 |
var list_ids_array = new Array();
|
465 |
console.log(final_list_ids);
|
466 |
jQuery("#inbound_shortcode_lists_hidden").val(final_list_ids);
|
467 |
});
|
468 |
+
|
469 |
+
/* add selected tags to hidden fields */
|
470 |
+
jQuery("body").on('change', '#inbound_shortcode_tags', function () {
|
471 |
+
var tag_ids = jQuery("#inbound_shortcode_tags").select2("data");
|
472 |
+
var tag_ids_array = new Array();
|
473 |
+
jQuery.each(tag_ids, function (key, valueObj) {
|
474 |
+
var the_id = valueObj['id'];
|
475 |
+
tag_ids_array.push(the_id);
|
476 |
+
});
|
477 |
+
|
478 |
+
var final_tag_ids = tag_ids_array.join();
|
479 |
+
console.log(final_tag_ids);
|
480 |
+
jQuery("#inbound_shortcode_tags_hidden").val(final_tag_ids);
|
481 |
+
});
|
482 |
}
|
483 |
|
484 |
if (shortcode_name === 'insert_call_to_action') {
|
shared/shortcodes/shortcodes-fields.php
CHANGED
@@ -173,6 +173,17 @@ if ( !class_exists('Inbound_Shortcodes_Fields') ) {
|
|
173 |
$output .= $row_end;
|
174 |
$this->append_output($output);
|
175 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
case 'multiselect' :
|
177 |
$output = $row_start;
|
178 |
$output .= '<select multiple name="'. $key .'" id="'.$key.'" class="inbound-shortcodes-input select inbound-shortcodes-select">';
|
173 |
$output .= $row_end;
|
174 |
$this->append_output($output);
|
175 |
break;
|
176 |
+
case 'leadtags' :
|
177 |
+
$output = $row_start;
|
178 |
+
$output .= '<select multiple name="'. $key .'" id="'.$key.'" class="inbound-shortcodes-input select inbound-shortcodes-select">';
|
179 |
+
foreach( $option['options'] as $val => $opt ) {
|
180 |
+
$selected = ($std == $val) ? ' selected="selected"' : '';
|
181 |
+
$output .= '<option'. $selected .' value="'. $val .'">'. $opt .'</option>';
|
182 |
+
}
|
183 |
+
$output .= '</select>';
|
184 |
+
$output .= $row_end;
|
185 |
+
$this->append_output($output);
|
186 |
+
break;
|
187 |
case 'multiselect' :
|
188 |
$output = $row_start;
|
189 |
$output .= '<select multiple name="'. $key .'" id="'.$key.'" class="inbound-shortcodes-input select inbound-shortcodes-select">';
|
shared/shortcodes/shortcodes-includes.php
CHANGED
@@ -8,7 +8,8 @@ $fontawesome = array("" => "None", "arrow-circle-o-right" => "Arrow Circle O Rig
|
|
8 |
$lp_cats = get_transient('landing-page-cats'); // array of landing page categories
|
9 |
$form_names = get_transient('inbound-form-names'); // array of landing page categories
|
10 |
$lead_mapping_fields = Leads_Field_Map::build_map_array();
|
11 |
-
$lead_list_names =
|
|
|
12 |
|
13 |
/* Global Inbound Now Shortcodes */
|
14 |
require_once('shortcodes/forms.php'); // Form Builder
|
8 |
$lp_cats = get_transient('landing-page-cats'); // array of landing page categories
|
9 |
$form_names = get_transient('inbound-form-names'); // array of landing page categories
|
10 |
$lead_mapping_fields = Leads_Field_Map::build_map_array();
|
11 |
+
$lead_list_names = Inbound_Leads::get_lead_lists_as_array();
|
12 |
+
$lead_tag_names = Inbound_Leads::get_lead_tags_as_array();
|
13 |
|
14 |
/* Global Inbound Now Shortcodes */
|
15 |
require_once('shortcodes/forms.php'); // Form Builder
|
shared/shortcodes/shortcodes/forms.php
CHANGED
@@ -12,6 +12,13 @@ if (empty($lead_list_names)){
|
|
12 |
);
|
13 |
}
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
$shortcodes_config['forms'] = array(
|
17 |
'no_preview' => false,
|
@@ -89,7 +96,19 @@ $shortcodes_config['forms'] = array(
|
|
89 |
'type' => 'hidden',
|
90 |
'class' => 'main-form-settings exclude-from-refresh',
|
91 |
),
|
92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
'helper-block-one' => array(
|
94 |
'name' => __('Name Name Name', 'inbound-pro' ),
|
95 |
'desc' => __('<span class="switch-to-form-insert button">Cancel Form Creation & Insert Existing Form</span>', 'inbound-pro' ),
|
@@ -223,7 +242,14 @@ $shortcodes_config['forms'] = array(
|
|
223 |
),
|
224 |
'std' => ''
|
225 |
),
|
226 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
'dropdown_options' => array(
|
228 |
'name' => __('Dropdown choices', 'inbound-pro' ),
|
229 |
'desc' => __('Enter Your Dropdown Options. Separate by commas. You may also use label|value to have a different value than the label stored.', 'inbound-pro' ),
|
@@ -301,14 +327,6 @@ $shortcodes_config['forms'] = array(
|
|
301 |
'std' => '0',
|
302 |
'class' => 'advanced',
|
303 |
),
|
304 |
-
'map_to' => array(
|
305 |
-
'name' => __('Map Field To <span class="small-optional-text">(optional)</span>', 'inbound-pro' ),
|
306 |
-
'desc' => __('Map this field to Leads Value', 'inbound-pro' ),
|
307 |
-
'type' => 'select',
|
308 |
-
'options' => $lead_mapping_fields,
|
309 |
-
'std' => 'none',
|
310 |
-
'class' => 'advanced exclude',
|
311 |
-
),
|
312 |
'placeholder' => array(
|
313 |
'name' => __('Field Placeholder <span class="small-optional-text">(optional)</span>', 'inbound-pro' ),
|
314 |
'desc' => __('Put field placeholder text here. Only works for normal text inputs', 'inbound-pro' ),
|
@@ -351,7 +369,7 @@ $shortcodes_config['forms'] = array(
|
|
351 |
'shortcode' => '[inbound_field label="{{label}}" type="{{field_type}}" description="{{description}}" required="{{required}}" exclude_tracking={{exclude_tracking}} dropdown="{{dropdown_options}}" radio="{{radio_options}}" checkbox="{{checkbox_options}}" range="{{range_options}}" placeholder="{{placeholder}}" field_container_class="{{field_container_class}}" field_input_class="{{field_input_class}}" html="{{html_block_options}}" dynamic="{{hidden_input_options}}" default="{{default_value}}" map_to="{{map_to}}" divider_options="{{divider_options}}"]',
|
352 |
'clone' => __('Add Another Field', 'inbound-pro' )
|
353 |
),
|
354 |
-
'shortcode' => '[inbound_form name="{{form_name}}" lists="{{lists_hidden}}" redirect="{{redirect}}" notify="{{notify}}" notify_subject="{{notify_subject}}" layout="{{layout}}" font_size="{{font-size}}" labels="{{labels}}" icon="{{icon}}" submit="{{submit}}" submit="{{submit}}" submit_colors="{{submit-colors}}" submit_text_color="{{submit-text-color}}" submit_bg_color="{{submit-bg-color}}" width="{{width}}"]{{child}}[/inbound_form]',
|
355 |
'popup_title' => 'Insert Inbound Form Shortcode'
|
356 |
);
|
357 |
|
@@ -470,48 +488,6 @@ if (!function_exists('inbound_get_form_names')) {
|
|
470 |
|
471 |
}
|
472 |
}
|
473 |
-
add_action('init', 'inbound_get_lead_list_names',16);
|
474 |
-
if (!function_exists('inbound_get_lead_list_names')) {
|
475 |
-
function inbound_get_lead_list_names() {
|
476 |
-
global $post;
|
477 |
-
|
478 |
-
$loop = get_transient( 'inbound-list-names' );
|
479 |
-
if ( false === $loop ) {
|
480 |
-
$args = array(
|
481 |
-
'hide_empty' => false,
|
482 |
-
);
|
483 |
-
$terms = get_terms('wplead_list_category', $args);
|
484 |
-
$list_names = array();
|
485 |
-
foreach ($terms as $term ) {
|
486 |
-
$list_names[$term->term_id] = $term->name;
|
487 |
-
}
|
488 |
-
|
489 |
-
set_transient('inbound-list-names', $list_names, 24 * HOUR_IN_SECONDS);
|
490 |
-
}
|
491 |
-
|
492 |
-
}
|
493 |
-
}
|
494 |
-
|
495 |
-
add_action( 'edit_term', 'inbound_lists_delete_transient', 10, 3 );
|
496 |
-
add_action( 'created_term', 'inbound_lists_delete_transient', 10, 3 );
|
497 |
-
add_action( 'edited_term', 'inbound_lists_delete_transient', 10, 3 );
|
498 |
-
add_action( 'create_term', 'inbound_lists_delete_transient', 10, 3 );
|
499 |
-
add_action( 'delete_term', 'inbound_lists_delete_transient', 10, 3 );
|
500 |
-
if (!function_exists('inbound_lists_delete_transient')) {
|
501 |
-
function inbound_lists_delete_transient( $term_id, $tt_id, $taxonomy ) {
|
502 |
-
global $wpdb;
|
503 |
-
//print_r($taxonomy); exit;
|
504 |
-
|
505 |
-
$whitelist = array( 'wplead_list_category' ); /* maybe this needs to include attachment, revision, feedback as well? */
|
506 |
-
if ( !in_array( $taxonomy, $whitelist ) ) {
|
507 |
-
return array( 'term_id' => $term_id, 'term_taxonomy_id' => $tt_id );
|
508 |
-
}
|
509 |
-
|
510 |
-
delete_transient('inbound-list-names');
|
511 |
-
inbound_get_lead_list_names();
|
512 |
-
|
513 |
-
}
|
514 |
-
}
|
515 |
|
516 |
add_action('save_post', 'inbound_form_delete_transient', 10, 2);
|
517 |
add_action('edit_post', 'inbound_form_delete_transient', 10, 2);
|
@@ -519,12 +495,14 @@ add_action('wp_insert_post', 'inbound_form_delete_transient', 10, 2);
|
|
519 |
if (!function_exists('inbound_form_delete_transient')) {
|
520 |
// Refresh transient
|
521 |
function inbound_form_delete_transient($post_id){
|
522 |
-
|
523 |
-
if(get_post_type( $post_id )
|
524 |
-
|
525 |
-
delete_transient('inbound-form-names');
|
526 |
-
inbound_get_form_names();
|
527 |
}
|
|
|
|
|
|
|
|
|
528 |
}
|
529 |
}
|
530 |
|
12 |
);
|
13 |
}
|
14 |
|
15 |
+
if (empty($lead_tag_names)){
|
16 |
+
// if lead transient doesn't exist use defaults
|
17 |
+
$lead_tag_names = array(
|
18 |
+
'null' => 'No Lists detected',
|
19 |
+
);
|
20 |
+
}
|
21 |
+
|
22 |
|
23 |
$shortcodes_config['forms'] = array(
|
24 |
'no_preview' => false,
|
96 |
'type' => 'hidden',
|
97 |
'class' => 'main-form-settings exclude-from-refresh',
|
98 |
),
|
99 |
+
'tags' => array(
|
100 |
+
'name' => __('Add Tags to Lead', 'inbound-pro' ),
|
101 |
+
'desc' => __('Tag the lead with these tags', 'inbound-pro' ),
|
102 |
+
'type' => 'leadtags',
|
103 |
+
'options' => $lead_tag_names,
|
104 |
+
'class' => 'main-form-settings exclude-from-refresh',
|
105 |
+
),
|
106 |
+
'tags_hidden' => array(
|
107 |
+
'name' => __('Hidden Tag Values', 'inbound-pro' ),
|
108 |
+
'desc' => __('Hidden Tag values', 'inbound-pro' ),
|
109 |
+
'type' => 'hidden',
|
110 |
+
'class' => 'main-form-settings exclude-from-refresh',
|
111 |
+
),
|
112 |
'helper-block-one' => array(
|
113 |
'name' => __('Name Name Name', 'inbound-pro' ),
|
114 |
'desc' => __('<span class="switch-to-form-insert button">Cancel Form Creation & Insert Existing Form</span>', 'inbound-pro' ),
|
242 |
),
|
243 |
'std' => ''
|
244 |
),
|
245 |
+
'map_to' => array(
|
246 |
+
'name' => __('Mapping', 'inbound-pro' ),
|
247 |
+
'desc' => __('This is required.', 'inbound-pro' ),
|
248 |
+
'type' => 'select',
|
249 |
+
'options' => $lead_mapping_fields,
|
250 |
+
'std' => 'none',
|
251 |
+
'class' => '',
|
252 |
+
),
|
253 |
'dropdown_options' => array(
|
254 |
'name' => __('Dropdown choices', 'inbound-pro' ),
|
255 |
'desc' => __('Enter Your Dropdown Options. Separate by commas. You may also use label|value to have a different value than the label stored.', 'inbound-pro' ),
|
327 |
'std' => '0',
|
328 |
'class' => 'advanced',
|
329 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
330 |
'placeholder' => array(
|
331 |
'name' => __('Field Placeholder <span class="small-optional-text">(optional)</span>', 'inbound-pro' ),
|
332 |
'desc' => __('Put field placeholder text here. Only works for normal text inputs', 'inbound-pro' ),
|
369 |
'shortcode' => '[inbound_field label="{{label}}" type="{{field_type}}" description="{{description}}" required="{{required}}" exclude_tracking={{exclude_tracking}} dropdown="{{dropdown_options}}" radio="{{radio_options}}" checkbox="{{checkbox_options}}" range="{{range_options}}" placeholder="{{placeholder}}" field_container_class="{{field_container_class}}" field_input_class="{{field_input_class}}" html="{{html_block_options}}" dynamic="{{hidden_input_options}}" default="{{default_value}}" map_to="{{map_to}}" divider_options="{{divider_options}}"]',
|
370 |
'clone' => __('Add Another Field', 'inbound-pro' )
|
371 |
),
|
372 |
+
'shortcode' => '[inbound_form name="{{form_name}}" lists="{{lists_hidden}}" tags="{{tags_hidden}}" redirect="{{redirect}}" notify="{{notify}}" notify_subject="{{notify_subject}}" layout="{{layout}}" font_size="{{font-size}}" labels="{{labels}}" icon="{{icon}}" submit="{{submit}}" submit="{{submit}}" submit_colors="{{submit-colors}}" submit_text_color="{{submit-text-color}}" submit_bg_color="{{submit-bg-color}}" width="{{width}}"]{{child}}[/inbound_form]',
|
373 |
'popup_title' => 'Insert Inbound Form Shortcode'
|
374 |
);
|
375 |
|
488 |
|
489 |
}
|
490 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
491 |
|
492 |
add_action('save_post', 'inbound_form_delete_transient', 10, 2);
|
493 |
add_action('edit_post', 'inbound_form_delete_transient', 10, 2);
|
495 |
if (!function_exists('inbound_form_delete_transient')) {
|
496 |
// Refresh transient
|
497 |
function inbound_form_delete_transient($post_id){
|
498 |
+
|
499 |
+
if(get_post_type( $post_id ) != 'inbound-forms') {
|
500 |
+
return;
|
|
|
|
|
501 |
}
|
502 |
+
|
503 |
+
delete_transient('inbound-form-names');
|
504 |
+
inbound_get_form_names();
|
505 |
+
|
506 |
}
|
507 |
}
|
508 |
|
templates/simple-solid-lite/config.php
CHANGED
@@ -80,7 +80,6 @@ if( function_exists('register_field_group') ):
|
|
80 |
|
81 |
<strong>In this guide you will learn:</strong>
|
82 |
|
83 |
-
[list icon="check" font_size="16" icon_color="#00a319" text_color="" bottom_margin="10"]
|
84 |
<ul>
|
85 |
<li>This list was created with the list icon shortcode.</li>
|
86 |
<li>Click on the power icon in your editor to customize your own</li>
|
@@ -88,7 +87,6 @@ if( function_exists('register_field_group') ):
|
|
88 |
<li>Keep it short and sweet.</li>
|
89 |
<li>This list should be easily scannable</li>
|
90 |
</ul>
|
91 |
-
[/list]
|
92 |
|
93 |
<p>This is the final sentence or paragraph reassuring the visitor of the benefits of filling out the form and how their data will be safe.</p>',
|
94 |
'tabs' => 'all',
|
80 |
|
81 |
<strong>In this guide you will learn:</strong>
|
82 |
|
|
|
83 |
<ul>
|
84 |
<li>This list was created with the list icon shortcode.</li>
|
85 |
<li>Click on the power icon in your editor to customize your own</li>
|
87 |
<li>Keep it short and sweet.</li>
|
88 |
<li>This list should be easily scannable</li>
|
89 |
</ul>
|
|
|
90 |
|
91 |
<p>This is the final sentence or paragraph reassuring the visitor of the benefits of filling out the form and how their data will be safe.</p>',
|
92 |
'tabs' => 'all',
|
templates/simple-solid-lite/index.php
CHANGED
@@ -84,7 +84,8 @@ $test = inbound_color_scheme($background_color, 'hex');
|
|
84 |
|
85 |
<?php
|
86 |
do_action('wp_head');
|
87 |
-
do_action('lp_head');
|
|
|
88 |
<style id="inbound-style-overrides" type="text/css">
|
89 |
|
90 |
<?php
|
84 |
|
85 |
<?php
|
86 |
do_action('wp_head');
|
87 |
+
do_action('lp_head');
|
88 |
+
?>
|
89 |
<style id="inbound-style-overrides" type="text/css">
|
90 |
|
91 |
<?php
|
templates/simple-two-column/config.php
CHANGED
@@ -66,7 +66,7 @@ if( function_exists('register_field_group') ):
|
|
66 |
|
67 |
<strong>In this guide you will learn:</strong>
|
68 |
|
69 |
-
|
70 |
<ul>
|
71 |
<li>This list was created with the list icon shortcode.</li>
|
72 |
<li>Click on the power icon in your editor to customize your own</li>
|
@@ -74,7 +74,6 @@ if( function_exists('register_field_group') ):
|
|
74 |
<li>Keep it short and sweet.</li>
|
75 |
<li>This list should be easily scannable</li>
|
76 |
</ul>
|
77 |
-
[/list]
|
78 |
|
79 |
<p>This is the final sentence or paragraph reassuring the visitor of the benefits of filling out the form and how their data will be safe.</p>',
|
80 |
'tabs' => 'all',
|
66 |
|
67 |
<strong>In this guide you will learn:</strong>
|
68 |
|
69 |
+
|
70 |
<ul>
|
71 |
<li>This list was created with the list icon shortcode.</li>
|
72 |
<li>Click on the power icon in your editor to customize your own</li>
|
74 |
<li>Keep it short and sweet.</li>
|
75 |
<li>This list should be easily scannable</li>
|
76 |
</ul>
|
|
|
77 |
|
78 |
<p>This is the final sentence or paragraph reassuring the visitor of the benefits of filling out the form and how their data will be safe.</p>',
|
79 |
'tabs' => 'all',
|