aboutsummaryrefslogtreecommitdiffstats
path: root/runtests.php
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2015-07-31 14:05:11 +0300
committerFilipp Lepalaan <filipp@mac.com>2015-07-31 14:05:11 +0300
commitff0bc847d54df3ca01c0dc17cd5b53b2900e69c9 (patch)
tree0d77d34fe2206433ffbb6051321c784e5699543f /runtests.php
parent8ced92e8e91920485ade1b3b9d7fe9a714eadfe9 (diff)
downloadgsxlib-ff0bc847d54df3ca01c0dc17cd5b53b2900e69c9.tar.gz
gsxlib-ff0bc847d54df3ca01c0dc17cd5b53b2900e69c9.tar.bz2
gsxlib-ff0bc847d54df3ca01c0dc17cd5b53b2900e69c9.zip
Added tests for new changes
Diffstat (limited to 'runtests.php')
-rw-r--r--runtests.php22
1 files changed, 16 insertions, 6 deletions
diff --git a/runtests.php b/runtests.php
index 6619cc5..fa87c70 100644
--- a/runtests.php
+++ b/runtests.php
@@ -6,23 +6,31 @@ require_once('gsxlib.php');
class GsxlibTest extends UnitTestCase
{
function setUp() {
- global $argv;
- $this->gsx = GsxLib::getInstance($argv[1], $argv[2], $argv[3], 'ut', 'emea', 'CEST', 'es');
+ $this->sn = $_ENV['GSX_SN'];
+ $this->gsx = GsxLib::getInstance($_ENV['GSX_SOLDTO'], $_ENV['GSX_USER'], 'ut');
}
function testWarranty() {
- $wty = $this->gsx->warrantyStatus('RM6501PXU9C');
+ $wty = $this->gsx->warrantyStatus($this->sn);
$this->assertEqual($wty->warrantyStatus, 'Out Of Warranty (No Coverage)');
}
+ function testSymptomIssue() {
+ $r = $this->gsx->fetchSymptomIssue($this->sn);
+ $this->assertEqual($r->symptoms[0]->reportedSymptomCode, 6115);
+ $this->assertEqual($r->symptoms[1]->reportedSymptomDesc, "Accidental damage");
+ }
+
function testCreateCarryInRepair() {
+ $symptom = $this->gsx->fetchSymptomIssue($this->sn)->symptoms[0];
+
$repairData = array(
'shipTo' => '6191',
- 'serialNumber' => 'RM6501PXU9C',
+ 'serialNumber' => $this->sn,
'diagnosedByTechId' => 'USA022SN',
'symptom' => 'Sample symptom',
'diagnosis' => 'Sample diagnosis',
- 'unitReceivedDate' => '07/02/13',
+ 'unitReceivedDate' => '07/25/15',
'unitReceivedTime' => '12:40 PM',
'notes' => 'A sample notes',
'poNumber' => '11223344',
@@ -47,13 +55,15 @@ class GsxlibTest extends UnitTestCase
'lastName' => 'Customer lastname',
'primaryPhone' => '4088887766'
),
+ 'reportedSymptomCode' => $symptom->reportedSymptomCode,
+ 'reportedIssueCode' => 'IP025',
);
$this->gsx->createCarryinRepair($repairData);
}
- function testCreateMailInRepair() {
+ function _testCreateMailInRepair() {
$repairData = array(
'shipTo' => '6191',
'accidentalDamage' => false,