diff options
author | Filipp Lepalaan <f@230.to> | 2013-07-12 11:41:15 +0300 |
---|---|---|
committer | Filipp Lepalaan <f@230.to> | 2013-07-12 11:41:15 +0300 |
commit | 28e37f2f89091eafa1eeeb38dd9be9d9515e0be7 (patch) | |
tree | a2f4d61a7d697541f02fcb05ea7d0597a8f3b88b /runtests.php | |
parent | 6a6d4fe0e52d2b396c1eabebf4622df1d69e410a (diff) | |
download | gsxlib-28e37f2f89091eafa1eeeb38dd9be9d9515e0be7.tar.gz gsxlib-28e37f2f89091eafa1eeeb38dd9be9d9515e0be7.tar.bz2 gsxlib-28e37f2f89091eafa1eeeb38dd9be9d9515e0be7.zip |
Added Mail-In repair support, some basic unit tests
Diffstat (limited to 'runtests.php')
-rw-r--r-- | runtests.php | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/runtests.php b/runtests.php new file mode 100644 index 0000000..c1323e8 --- /dev/null +++ b/runtests.php @@ -0,0 +1,105 @@ +<?php + +require_once('simpletest/autorun.php'); +require_once('gsxlib.php'); + +class GsxlibTest extends UnitTestCase +{ + function setUp() { + global $argv; + $this->gsx = GsxLib::getInstance($argv[1], $argv[2], $argv[3], 'ut'); + } + + function testWarranty() { + $wty = $this->gsx->warrantyStatus('RM6501PXU9C'); + $this->assertEqual($wty->warrantyStatus, 'Out Of Warranty (No Coverage)'); + } + + function testCreateCarryInRepair() { + $repairData = array( + 'shipTo' => '6191', + 'serialNumber' => 'RM6501PXU9C', + 'diagnosedByTechId' => 'USA022SN', + 'symptom' => 'Sample symptom', + 'diagnosis' => 'Sample diagnosis', + 'unitReceivedDate' => '07/02/13', + 'unitReceivedTime' => '12:40 PM', + 'notes' => 'A sample notes', + 'poNumber' => '11223344', + 'popFaxed' => false, + 'orderLines' => array( + 'partNumber' => '076-1080', + 'comptiaCode' => '660', + 'comptiaModifier' => 'A', + 'abused' => false + ), + 'customerAddress' => array( + 'addressLine1' => 'Address line 1', + 'country' => 'US', + 'city' => 'Cupertino', + 'state' => 'CA', + 'street' => 'Valley Green Dr', + 'zipCode' => '95014', + 'regionCode' => '005', + 'companyName' => 'Apple Inc', + 'emailAddress' => 'test@example.com', + 'firstName' => 'Customer Firstname', + 'lastName' => 'Customer lastname', + 'primaryPhone' => '4088887766' + ), + ); + + $this->gsx->createCarryinRepair($repairData); + + } + + function testCreateMailInRepair() { + $repairData = array( + 'shipTo' => '6191', + 'accidentalDamage' => false, + 'addressCosmeticDamage' => false, + 'comptia' => array( + 'comptiaCode' => 'X01', + 'comptiaModifier' => 'D', + 'comptiaGroup' => 1, + 'technicianNote' => 'sample technician notes' + ), + 'requestReviewByApple' => false, + 'serialNumber' => 'RM6501PXU9C', + 'diagnosedByTechId' => 'USA022SN', + 'symptom' => 'Sample symptom', + 'diagnosis' => 'Sample diagnosis', + 'unitReceivedDate' => '07/02/13', + 'unitReceivedTime' => '12:40 PM', + 'notes' => 'A sample notes', + 'purchaseOrderNumber' => 'AB12345', + 'trackingNumber' => '12345', + 'shipper' => 'XDHL', + 'soldToContact' => 'Cupertino', + 'popFaxed' => false, + 'orderLines' => array( + 'partNumber' => '076-1080', + 'comptiaCode' => '660', + 'comptiaModifier' => 'A', + 'abused' => false + ), + 'customerAddress' => array( + 'addressLine1' => 'Address line 1', + 'country' => 'US', + 'city' => 'Cupertino', + 'state' => 'CA', + 'street' => 'Valley Green Dr', + 'zipCode' => '95014', + 'regionCode' => '005', + 'companyName' => 'Apple Inc', + 'emailAddress' => 'test@example.com', + 'firstName' => 'Customer Firstname', + 'lastName' => 'Customer lastname', + 'primaryPhone' => '4088887766' + ), + ); + + $this->gsx->createMailinRepair($repairData); + + } +} |