From ff0bc847d54df3ca01c0dc17cd5b53b2900e69c9 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Fri, 31 Jul 2015 14:05:11 +0300 Subject: Added tests for new changes --- runtests.php | 22 ++++++++++++++++------ 1 file 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, -- cgit v1.2.3