Title: Unit Test Errors
Last modified: November 9, 2020

---

# Unit Test Errors

 *  Resolved [maysammu](https://wordpress.org/support/users/maysammu/)
 * (@maysammu)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/unit-test-errors/)
 * New to the plugin. I have created a post with amazon links, but I do not see 
   the affiliate tag added automatically. The button functionality seems to work
   however. When I ran the unit tests every test fails with errors similar to below
   errors. WordPress version is 5.5.1.
 * Any help is appreciated.
 * Failed AmazonAutoLinks_UnitTest_FrameworkUtility
    500: error .wp-die-message {
   display: none; } Fatal error: Uncaught Error: Wrong parameters for Exception([
   string $message [, long $code [, Throwable $previous = NULL]]])in /var/www/wordpress/
   wp-content/plugins/amazon-auto-links/include/core/component/test/event/ajax/AmazonAutoLinks_Test_Event_Ajax_Tests.
   php on line 80Call stack:Exception::__construct()wp-content/plugins/amazon-auto-
   links/include/core/component/test/event/ajax/AmazonAutoLinks_Test_Event_Ajax_Tests.
   php:80AmazonAutoLinks_Test_Event_Ajax_Tests::_getResponse()wp-content/plugins/
   amazon-auto-links/include/core/_common/event/ajax/AmazonAutoLinks_AjaxEvent_Base.
   php:82AmazonAutoLinks_AjaxEvent_Base::_doAction()wp-content/plugins/amazon-auto-
   links/include/core/_common/event/wpcron/AmazonAutoLinks_Event___Action_Base.php:
   72AmazonAutoLinks_Event___Action_Base::replyToDoAction()wp-includes/class-wp-
   hook.php:287WP_Hook::apply_filters()wp-includes/class-wp-hook.php:311WP_Hook::
   do_action()wp-includes/plugin.php:478do_action()wp-admin/admin-ajax.php:176Query
   MonitorThere has been a critical error on your website.Learn more about debugging
   in WordPress.File: var/www/wordpress/wp-content/plugins/amazon-auto-links/include/
   core/component/test/run/tests/admin_page_framework/AmazonAutoLinks_UnitTest_FrameworkUtility.
   php
 * Failed AmazonAutoLinks_UnitTest_FrameworkUtility_Transient
    500: error .wp-die-
   message { display: none; } Fatal error: Uncaught Error: Wrong parameters for 
   Exception([string $message [, long $code [, Throwable $previous = NULL]]])in /
   var/www/wordpress/wp-content/plugins/amazon-auto-links/include/core/component/
   test/event/ajax/AmazonAutoLinks_Test_Event_Ajax_Tests.php on line 80Call stack:
   Exception::__construct()wp-content/plugins/amazon-auto-links/include/core/component/
   test/event/ajax/AmazonAutoLinks_Test_Event_Ajax_Tests.php:80AmazonAutoLinks_Test_Event_Ajax_Tests::
   _getResponse()wp-content/plugins/amazon-auto-links/include/core/_common/event/
   ajax/AmazonAutoLinks_AjaxEvent_Base.php:82AmazonAutoLinks_AjaxEvent_Base::_doAction()
   wp-content/plugins/amazon-auto-links/include/core/_common/event/wpcron/AmazonAutoLinks_Event___Action_Base.
   php:72AmazonAutoLinks_Event___Action_Base::replyToDoAction()wp-includes/class-
   wp-hook.php:287WP_Hook::apply_filters()wp-includes/class-wp-hook.php:311WP_Hook::
   do_action()wp-includes/plugin.php:478do_action()wp-admin/admin-ajax.php:176Query
   MonitorThere has been a critical error on your website.Learn more about debugging
   in WordPress.File: var/www/wordpress/wp-content/plugins/amazon-auto-links/include/
   core/component/test/run/tests/admin_page_framework/AmazonAutoLinks_UnitTest_FrameworkUtility_Transient.
   php
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Funit-test-errors%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Plugin Author [miunosoft](https://wordpress.org/support/users/miunosoft/)
 * (@miunosoft)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/unit-test-errors/#post-13641707)
 * Hi,
 * If you are using a shortcode, you need to added a default Associate tag via Dashboard-
   > Amazon Auto Links -> Settings -> Default.
 * > … do_action()wp-admin/admin-ajax.php:176Query MonitorThere has been a critical
   > error on your website.Learn more …
 * Looks like a conflict with Query Monitor. Try disabling it temporarily while 
   you test.
 * Also, post relevant error log found in _debug.log_ under the _wp-content_ directory
   if you are enabling the site debug mode.
 * Also, I’d like to know your PHP version which can be found via Dashboard -> Tools-
   > Site Health -> Info -> Server.
 *  Thread Starter [maysammu](https://wordpress.org/support/users/maysammu/)
 * (@maysammu)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/unit-test-errors/#post-13641783)
 * Thank you for the response.
    I can confirm that “Associate ID” in setting->default
   tab is populated. PHP version is: 7.2.20-1+ubuntu16.04.1+deb.sury.org+1 (Supports
   64bit values)
 * Here is what I see in debug.log:
 * [10-Nov-2020 01:53:07 UTC] PHP Fatal error: Uncaught Error: Wrong parameters 
   for Exception([string $message [, long $code [, Throwable $previous = NULL]]])
   in /var/www/wordpress/wp-content/plugins/amazon-auto-links/include/core/component/
   test/event/ajax/AmazonAutoLinks_Test_Event_Ajax_Tests.php:80
    Stack trace: #0/
   var/www/wordpress/wp-content/plugins/amazon-auto-links/include/core/component/
   test/event/ajax/AmazonAutoLinks_Test_Event_Ajax_Tests.php(80): Exception->__construct(
   Array) #1 /var/www/wordpress/wp-content/plugins/amazon-auto-links/include/core/
   _common/event/ajax/AmazonAutoLinks_AjaxEvent_Base.php(82): AmazonAutoLinks_Test_Event_Ajax_Tests-
   >_getResponse(Array) #2 /var/www/wordpress/wp-content/plugins/amazon-auto-links/
   include/core/_common/event/wpcron/AmazonAutoLinks_Event___Action_Base.php(72):
   AmazonAutoLinks_AjaxEvent_Base->_doAction(”) #3 /var/www/wordpress/wp-includes/
   class-wp-hook.php(287): AmazonAutoLinks_Event___Action_Base->replyToDoAction(”)#
   4 /var/www/wordpress/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”,
   Array) in /var/www/wordpress/wp-content/plugins/amazon-auto-links/include/core/
   component/test/event/ajax/AmazonAutoLinks_Test_Event_Ajax_Tests.php on line 80[
   10-Nov-2020 01:53:08 UTC] PHP Notice: Undefined variable: write in /var/www/wordpress/
   wp-content/db.php on line 588 [10-Nov-2020 01:53:08 UTC] PHP Notice: Undefined
   variable: write in /var/www/wordpress/wp-content/db.php on line 625 [10-Nov-2020
   01:53:08 UTC] PHP Fatal error: Uncaught Error: Wrong parameters for Exception([
   string $message [, long $code [, Throwable $previous = NULL]]]) in /var/www/wordpress/
   wp-content/plugins/amazon-auto-links/include/core/component/test/event/ajax/AmazonAutoLinks_Test_Event_Ajax_Tests.
   php:80 Stack trace: #0 /var/www/wordpress/wp-content/plugins/amazon-auto-links/
   include/core/component/test/event/ajax/AmazonAutoLinks_Test_Event_Ajax_Tests.
   php(80): Exception->__construct(Array) #1 /var/www/wordpress/wp-content/plugins/
   amazon-auto-links/include/core/_common/event/ajax/AmazonAutoLinks_AjaxEvent_Base.
   php(82): AmazonAutoLinks_Test_Event_Ajax_Tests->_getResponse(Array) #2 /var/www/
   wordpress/wp-content/plugins/amazon-auto-links/include/core/_common/event/wpcron/
   AmazonAutoLinks_Event___Action_Base.php(72): AmazonAutoLinks_AjaxEvent_Base->
   _doAction(”) #3 /var/www/wordpress/wp-includes/class-wp-hook.php(287): AmazonAutoLinks_Event___Action_Base-
   >replyToDoAction(”) #4 /var/www/wordpress/wp-includes/class-wp-hook.php(311):
   WP_Hook->apply_filters(”, Array) in /var/www/wordpress/wp-content/plugins/amazon-
   auto-links/include/core/component/test/event/ajax/AmazonAutoLinks_Test_Event_Ajax_Tests.
   php on line 80
 *  Thread Starter [maysammu](https://wordpress.org/support/users/maysammu/)
 * (@maysammu)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/unit-test-errors/#post-13641784)
 * also, I did disable query monitor plugin before I ran the test
 *  Plugin Author [miunosoft](https://wordpress.org/support/users/miunosoft/)
 * (@miunosoft)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/unit-test-errors/#post-13642181)
 * I see.
 * I’ve uploaded the development version [4.4.0b02](https://downloads.wordpress.org/plugin/amazon-auto-links.zip)
   which should fix the test error you reported. So please try that. You may get
   another error however. In that case post the error message.
 * As for the associate tag issue addressed initially, I checked your site and the
   product links and they seem fine to me. If a product URL contains a string _tag
   ={your associate tag}_, it should be okay. What makes you say “but I do not see
   the affiliate tag added automatically.”?
 *  Thread Starter [maysammu](https://wordpress.org/support/users/maysammu/)
 * (@maysammu)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/unit-test-errors/#post-13642284)
 * Ok I will install and test, thank you again.
 * On the original issue, looks like my editorial team went in and manually updated
   all the links by going to amazon affiliate page and generating links. So you 
   can see, I put the original link back on the first item on the list “Gotta Go
   Flamingo”. You can see it points to “[https://www.amazon.com/Little-Live-Pets-Famingo-Single/dp/B084NWRCGY/&#8221](https://www.amazon.com/Little-Live-Pets-Famingo-Single/dp/B084NWRCGY/&#8221);
 *  Thread Starter [maysammu](https://wordpress.org/support/users/maysammu/)
 * (@maysammu)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/unit-test-errors/#post-13642334)
 * I ran the first test “admin_page_framework” and the following shows under results:
 * Failed
    The file does not exist:
 * File: var/www/wordpress/wp-content/plugins/amazon-auto-links/include/core/component/
   test/run/tests/admin_page_framework/AmazonAutoLinks_UnitTest_FrameworkUtility.
   php
 * Line: 62
 * Failed
    The file does not exist:
 * File: var/www/wordpress/wp-content/plugins/amazon-auto-links/include/core/component/
   test/run/tests/admin_page_framework/AmazonAutoLinks_UnitTest_FrameworkUtility_Transient.
   php
 * Line: 62
 * Failed
    The file does not exist:
 * File: var/www/wordpress/wp-content/plugins/amazon-auto-links/include/core/component/
   test/run/tests/http/bestsellers/Test_AmazonAutoLinks_HTTPClient_BestSellers.php
 * Line: 62
 *  Plugin Author [miunosoft](https://wordpress.org/support/users/miunosoft/)
 * (@miunosoft)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/unit-test-errors/#post-13642348)
 * I checked your site again and it seems the buttons are produced by Amazon Auto
   Links but the images, the titles, and their links are not of Amazon Auto Links.
 * How are you displaying the buttons?
    -  This reply was modified 5 years, 4 months ago by [miunosoft](https://wordpress.org/support/users/miunosoft/).
 *  Plugin Author [miunosoft](https://wordpress.org/support/users/miunosoft/)
 * (@miunosoft)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/unit-test-errors/#post-13642358)
 * As for the errors on tests mentioned in your last reply, they say test files 
   are missing. Did you install Amazon Auto Links v4.4.0b02?
 *  Thread Starter [maysammu](https://wordpress.org/support/users/maysammu/)
 * (@maysammu)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/unit-test-errors/#post-13642417)
 * We are using the button shortcut. But for links we just paste the link. I understand
   copying the links directly should work and the plug-in would append the tags 
   automatically right?
    I downloaded and uploaded the zip file. I will check again
   tomorrow. The unit tests are less critical if the link functionality is working.
   Thank you
 *  Plugin Author [miunosoft](https://wordpress.org/support/users/miunosoft/)
 * (@miunosoft)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/unit-test-errors/#post-13642516)
 * I see. The plugin only insert a user-set Amazon Associate tag to Amazon product
   links to plugin generated outputs such as by unit, the shortcode and widgets.
 * In your case, you are manually posting images and titles. In that case, you want
   to enable the _Link Converter_ option via **Dashboard** -> **Amazon Auto Links**-
   > **Settings** -> **Converter** -> **Convert Links**. Select **On** for the **
   Enable** field and check **Post content** for the **Applies to** field.
 * Hope this helps.
 * By the way, for your information, Amazon Auto Links allows you to generate and
   insert product outputs by just pasting a product URL in the editor like “[https://www.amazon.com/Little-Live-Pets-Famingo-Single/dp/B084NWRCGY/&#8221](https://www.amazon.com/Little-Live-Pets-Famingo-Single/dp/B084NWRCGY/&#8221);.
 *  Thread Starter [maysammu](https://wordpress.org/support/users/maysammu/)
 * (@maysammu)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/unit-test-errors/#post-13645600)
 * Thank you very much for jumping on this and helping, I see it working. You rule!
 *  Plugin Author [miunosoft](https://wordpress.org/support/users/miunosoft/)
 * (@miunosoft)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/unit-test-errors/#post-13646545)
 * You are welcome!
 * Would be appreciated if you could take a few minutes to [write a review](https://wordpress.org/support/plugin/amazon-auto-links/reviews/)
   on the plugin.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Unit Test Errors’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/amazon-auto-links_eeeeee.svg)
 * [Auto Amazon Links - Amazon Associates Affiliate Plugin](https://wordpress.org/plugins/amazon-auto-links/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amazon-auto-links/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amazon-auto-links/)
 * [Active Topics](https://wordpress.org/support/plugin/amazon-auto-links/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amazon-auto-links/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amazon-auto-links/reviews/)

## Tags

 * [amazon](https://wordpress.org/support/topic-tag/amazon/)
 * [Amazon affiliate](https://wordpress.org/support/topic-tag/amazon-affiliate/)
 * [amazon associates](https://wordpress.org/support/topic-tag/amazon-associates/)
 * [unit-test](https://wordpress.org/support/topic-tag/unit-test/)

 * 12 replies
 * 2 participants
 * Last reply from: [miunosoft](https://wordpress.org/support/users/miunosoft/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/unit-test-errors/#post-13646545)
 * Status: resolved