Skip to content

Commit 85d4950

Browse files
committed
Test Automation support added
1 parent 799a296 commit 85d4950

File tree

5 files changed

+429
-417
lines changed

5 files changed

+429
-417
lines changed

src/lib/models/stack.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function ImageTrasform($url, $parameters)
149149
public function getLastActivities()
150150
{
151151
$this->_query = array("only_last_activity" => "true");
152-
return Utility\getLastActivites($this);
152+
return Utility::getLastActivites($this);
153153
}
154154

155155
/**
@@ -161,7 +161,7 @@ public function getLastActivities()
161161
* */
162162
public function setHost($host = '')
163163
{
164-
Utility\validateInput('host', $host);
164+
Utility::validateInput('host', $host);
165165
$this->host = $host;
166166
return $this;
167167
}
@@ -183,7 +183,7 @@ public function getHost()
183183
* */
184184
public function setProtocol($protocol = '')
185185
{
186-
Utility\validateInput('protocol', $protocol);
186+
Utility::validateInput('protocol', $protocol);
187187
$this->protocol = $protocol;
188188
return $this;
189189
}
@@ -205,7 +205,7 @@ public function getProtocol()
205205
* */
206206
public function setPort($port = '')
207207
{
208-
Utility\validateInput('port', $port);
208+
Utility::validateInput('port', $port);
209209
$this->port = $port;
210210
return $this;
211211
}
@@ -229,7 +229,7 @@ public function getPort()
229229
* */
230230
public function setAPIKEY($api_key = '')
231231
{
232-
Utility\validateInput('api_key', $api_key);
232+
Utility::validateInput('api_key', $api_key);
233233
$this->header['api_key'] = $api_key;
234234
return $this;
235235
}
@@ -242,7 +242,7 @@ public function setAPIKEY($api_key = '')
242242
* */
243243
public function setDeliveryToken($delivery_token = '')
244244
{
245-
Utility\validateInput('access_token', $delivery_token);
245+
Utility::validateInput('access_token', $delivery_token);
246246
$this->header['access_token'] = $delivery_token;
247247
return $this;
248248
}
@@ -256,7 +256,7 @@ public function setDeliveryToken($delivery_token = '')
256256
* */
257257
public function setEnvironment($environment = '')
258258
{
259-
Utility\validateInput('environment', $environment);
259+
Utility::validateInput('environment', $environment);
260260
$this->environment = $environment;
261261
return $this;
262262
}

test/AssetsTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ class AssetsTest extends TestCase {
1818
public static function setUpBeforeClass() : void {
1919
self::$rest = new REST();
2020
self::$Stack = Contentstack\Contentstack::Stack(self::$rest->getAPIKEY(), self::$rest->getAccessToken(), self::$rest->getEnvironmentName());
21+
if (!is_null($rest->getHost())) {
22+
self::$Stack->setHost($rest->getHost());
23+
}
2124
}
2225
/*
2326
* Tear Down after the test suites executes

0 commit comments

Comments
 (0)