Reply
Highlighted
Member
Posts: 2
Registered: ‎07-29-2011

The PHP SDK's unit tests are failing

I'm evaluating the Authorize.Net PHP SDK (version 3.1.2) to see if it will meet my company's integration needs. As a first step, I downloaded the SDK and ran its built-in suite of unit tests.

 

Unfortunately the unit tests yield a number of errors and failures (see below). I'm reluctant to use the SDK if it doesn't pass its own unit test suite! Has anyone encountered these errors, or been able to fix them or work around them?

 

I'm running the unit tests in PHP 5.2.5 on Windows. I've enabled the required PHP extensions, along with the SOAP and OpenSSL extensions which are not documented as requirements, but appear to be necessary to run the SOAP-related unit tests.

 

The output of the test suite is as follows:

 

E:\Projects\anet_php_sdk\tests>phpunit .
PHPUnit 3.4.9 by Sebastian Bergmann.

........F.....................F..........EEEEEEE.......FFFEF 60 / 63
F..

Time: 26 seconds, Memory: 6.25Mb

There were 8 errors:

1) AuthorizeNetCP_Test::testAuthCapture
Undefined property:  AuthorizeNetCP::$_custom_fields

E:\Projects\anet_php_sdk\lib\AuthorizeNetCP.php:86
E:\Projects\anet_php_sdk\lib\shared\AuthorizeNetRequest.php:117
E:\Projects\anet_php_sdk\lib\AuthorizeNetAIM.php:112
E:\Projects\anet_php_sdk\tests\AuthorizeNetCP_Test.php:19

2) AuthorizeNetCP_Test::testAuthCaptureTrack1
Undefined property:  AuthorizeNetCP::$_custom_fields

E:\Projects\anet_php_sdk\lib\AuthorizeNetCP.php:86
E:\Projects\anet_php_sdk\lib\shared\AuthorizeNetRequest.php:117
E:\Projects\anet_php_sdk\lib\AuthorizeNetAIM.php:112
E:\Projects\anet_php_sdk\tests\AuthorizeNetCP_Test.php:50

3) AuthorizeNetCP_Test::testAuthCaptureTrack2
Undefined property:  AuthorizeNetCP::$_custom_fields

E:\Projects\anet_php_sdk\lib\AuthorizeNetCP.php:86
E:\Projects\anet_php_sdk\lib\shared\AuthorizeNetRequest.php:117
E:\Projects\anet_php_sdk\lib\AuthorizeNetAIM.php:112
E:\Projects\anet_php_sdk\tests\AuthorizeNetCP_Test.php:64

4) AuthorizeNetCP_Test::testAuthCaptureTrack2Error
Undefined property:  AuthorizeNetCP::$_custom_fields

E:\Projects\anet_php_sdk\lib\AuthorizeNetCP.php:86
E:\Projects\anet_php_sdk\lib\shared\AuthorizeNetRequest.php:117
E:\Projects\anet_php_sdk\lib\AuthorizeNetAIM.php:112
E:\Projects\anet_php_sdk\tests\AuthorizeNetCP_Test.php:78

5) AuthorizeNetCP_Test::testResponseFields
Undefined property:  AuthorizeNetCP::$_custom_fields

E:\Projects\anet_php_sdk\lib\AuthorizeNetCP.php:86
E:\Projects\anet_php_sdk\lib\shared\AuthorizeNetRequest.php:117
E:\Projects\anet_php_sdk\lib\AuthorizeNetAIM.php:112
E:\Projects\anet_php_sdk\tests\AuthorizeNetCP_Test.php:95

6) AuthorizeNetCP_Test::testXmlResponse
Undefined property:  AuthorizeNetCP::$_custom_fields

E:\Projects\anet_php_sdk\lib\AuthorizeNetCP.php:86
E:\Projects\anet_php_sdk\lib\shared\AuthorizeNetRequest.php:117
E:\Projects\anet_php_sdk\lib\AuthorizeNetAIM.php:112
E:\Projects\anet_php_sdk\tests\AuthorizeNetCP_Test.php:127

7) AuthorizeNetCP_Test::testXmlResponseFailure
Undefined property:  AuthorizeNetCP::$_custom_fields

E:\Projects\anet_php_sdk\lib\AuthorizeNetCP.php:86
E:\Projects\anet_php_sdk\lib\shared\AuthorizeNetRequest.php:117
E:\Projects\anet_php_sdk\lib\AuthorizeNetAIM.php:112
E:\Projects\anet_php_sdk\tests\AuthorizeNetCP_Test.php:159

8) AuthorizeNetTD_Test::testGetTransactionsForDay
Undefined property:  AuthorizeNetTD_Response::$xpath_xml

E:\Projects\anet_php_sdk\lib\shared\AuthorizeNetXMLResponse.php:54
E:\Projects\anet_php_sdk\lib\AuthorizeNetTD.php:104
E:\Projects\anet_php_sdk\tests\AuthorizeNetTD_Test.php:35

--


There were 7 failures:

1) AuthorizeNetAIM_Sandbox_Test::testAuthCaptureECheckSandbox
Failed asserting that <boolean:false> is true.

E:\Projects\anet_php_sdk\tests\AuthorizeNetAIM_Test.php:285

2) AuthorizeNetARB_Test::testAllMethods
Failed asserting that <boolean:false> is true.

E:\Projects\anet_php_sdk\tests\AuthorizeNetARB_Test.php:27

3) AuthorizeNetTD_Test::testGetSettledBatchList
Failed asserting that <boolean:false> is true.

E:\Projects\anet_php_sdk\tests\AuthorizeNetTD_Test.php:14

4) AuthorizeNetTD_Test::testGetSettledBatchListIncludeStatistics
Failed asserting that <boolean:false> is true.

E:\Projects\anet_php_sdk\tests\AuthorizeNetTD_Test.php:22

5) AuthorizeNetTD_Test::testGetSettledBatchListForMonth
Failed asserting that <boolean:false> is true.

E:\Projects\anet_php_sdk\tests\AuthorizeNetTD_Test.php:29

6) AuthorizeNetTD_Test::testGetTransactionList
Failed asserting that <boolean:false> is true.

E:\Projects\anet_php_sdk\tests\AuthorizeNetTD_Test.php:43

7) AuthorizeNetTD_Test::testGetTransactionDetails
Failed asserting that <boolean:false> is true.

E:\Projects\anet_php_sdk\tests\AuthorizeNetTD_Test.php:61

FAILURES!
Tests: 63, Assertions: 175, Failures: 7, Errors: 8.

E:\Projects\anet_php_sdk\tests>



 

Highlighted
Member
Posts: 2
Registered: ‎07-29-2011

Re: The PHP SDK's unit tests are failing

Upon further examination, I figured out that these unit tests failures and errors can all be traced to specific features that aren't enabled by default in our test account. For example, our test account doesn't handle partial authorizations, so that unit test was failing.

 

It would be nice if the unit tests or their documentation could take into account this sort of configuration dependency. Regardless, I hope my post to the forum will help someone in the future.

Highlighted
All Star
Posts: 1,072
Registered: ‎08-17-2009

Re: The PHP SDK's unit tests are failing

Glad you got it figure out! And thanks for the suggestion. I'll pass that on to our developers for a future SDK update.

 

Thanks,

 

Michelle

Developer Community Manager

Highlighted
Member
Posts: 3
Registered: ‎02-11-2013

Re: The PHP SDK's unit tests are failing

Issue still presents through a years :(