aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--gsxlib.php20
-rw-r--r--runtests.php2
3 files changed, 12 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e419776
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+simpletest \ No newline at end of file
diff --git a/gsxlib.php b/gsxlib.php
index dfea4e3..b4eec45 100644
--- a/gsxlib.php
+++ b/gsxlib.php
@@ -32,7 +32,8 @@ class GsxLib
$password,
$environment = '',
$region = 'emea',
- $tz = 'CEST')
+ $tz = 'CEST',
+ $lang = 'en')
{
if(!(self::$_instance instanceof self)) {
self::$_instance = new self(
@@ -41,7 +42,8 @@ class GsxLib
$password,
$environment,
$region,
- $tz
+ $tz,
+ $lang
);
}
@@ -57,7 +59,8 @@ class GsxLib
$password,
$environment = '',
$region = 'emea',
- $tz = 'CEST' )
+ $tz = 'CEST',
+ $lang = 'en' )
{
if(!class_exists('SoapClient')) {
throw new GsxException('Looks like your PHP lacks SOAP support');
@@ -110,7 +113,7 @@ class GsxLib
'userId' => $username,
'password' => $password,
'serviceAccountNo' => $account,
- 'languageCode' => 'en',
+ 'languageCode' => $lang,
'userTimeZone' => $tz,
)
);
@@ -124,7 +127,7 @@ class GsxLib
if($environment == '2') $environment = 'production';
$error = 'Authentication with GSX failed. Does this account have access to '
- .$environment."?\n";
+ .$environment." environment?\n";
throw new GsxException($error);
}
@@ -290,8 +293,7 @@ class GsxLib
'lookupRequestData' => $query
));
- $response = $this->client->RepairLookup($req)
- ->RepairLookupResponse;
+ $response = $this->client->RepairLookup($req)->RepairLookupResponse;
return $response->lookupResponseData;
}
@@ -436,9 +438,7 @@ class GsxLib
}
- $req = array('PartsLookup' => array(
- 'lookupRequestData' => $query
- ));
+ $req = array('PartsLookup' => array('lookupRequestData' => $query));
$result = $this->request($req)->parts;
// always return an array
diff --git a/runtests.php b/runtests.php
index c1323e8..6619cc5 100644
--- a/runtests.php
+++ b/runtests.php
@@ -7,7 +7,7 @@ class GsxlibTest extends UnitTestCase
{
function setUp() {
global $argv;
- $this->gsx = GsxLib::getInstance($argv[1], $argv[2], $argv[3], 'ut');
+ $this->gsx = GsxLib::getInstance($argv[1], $argv[2], $argv[3], 'ut', 'emea', 'CEST', 'es');
}
function testWarranty() {