Skip to content

Commit a6b188e

Browse files
committed
Globar renamed store/create, unstore/delete gateway requests
1 parent 12337bd commit a6b188e

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

src/Omnipay/Common/AbstractGateway.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,23 +170,23 @@ public function supportsVoid()
170170
}
171171

172172
/**
173-
* Supports Store
173+
* Supports Create
174174
*
175-
* @return boolean True if this gateway supports the store() method
175+
* @return boolean True if this gateway supports the create() method
176176
*/
177-
public function supportsStore()
177+
public function supportsCreate()
178178
{
179-
return method_exists($this, 'store');
179+
return method_exists($this, 'create');
180180
}
181181

182182
/**
183-
* Supports Unstore
183+
* Supports Delete
184184
*
185-
* @return boolean True if this gateway supports the unstore() method
185+
* @return boolean True if this gateway supports the delete() method
186186
*/
187-
public function supportsUnstore()
187+
public function supportsDelete()
188188
{
189-
return method_exists($this, 'unstore');
189+
return method_exists($this, 'delete');
190190
}
191191

192192
/**

tests/Omnipay/GatewayTestCase.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -149,27 +149,27 @@ public function testSupportsVoid()
149149
}
150150
}
151151

152-
public function testSupportsStore()
152+
public function testSupportsCreate()
153153
{
154-
$supportsStore = $this->gateway->supportsStore();
155-
$this->assertInternalType('boolean', $supportsStore);
154+
$supportsCreate = $this->gateway->supportsCreate();
155+
$this->assertInternalType('boolean', $supportsCreate);
156156

157-
if ($supportsStore) {
158-
$this->assertInstanceOf('Omnipay\Common\Message\RequestInterface', $this->gateway->store());
157+
if ($supportsCreate) {
158+
$this->assertInstanceOf('Omnipay\Common\Message\RequestInterface', $this->gateway->create());
159159
} else {
160-
$this->assertFalse(method_exists($this->gateway, 'store'));
160+
$this->assertFalse(method_exists($this->gateway, 'create'));
161161
}
162162
}
163163

164-
public function testSupportsUnstore()
164+
public function testSupportsDelete()
165165
{
166-
$supportsUnstore = $this->gateway->supportsUnstore();
167-
$this->assertInternalType('boolean', $supportsUnstore);
166+
$supportsDelete = $this->gateway->supportsDelete();
167+
$this->assertInternalType('boolean', $supportsDelete);
168168

169-
if ($supportsUnstore) {
170-
$this->assertInstanceOf('Omnipay\Common\Message\RequestInterface', $this->gateway->unstore());
169+
if ($supportsDelete) {
170+
$this->assertInstanceOf('Omnipay\Common\Message\RequestInterface', $this->gateway->delete());
171171
} else {
172-
$this->assertFalse(method_exists($this->gateway, 'unstore'));
172+
$this->assertFalse(method_exists($this->gateway, 'delete'));
173173
}
174174
}
175175

@@ -290,9 +290,9 @@ public function testVoidParameters()
290290
}
291291
}
292292

293-
public function testStoreParameters()
293+
public function testCreateParameters()
294294
{
295-
if ($this->gateway->supportsStore()) {
295+
if ($this->gateway->supportsCreate()) {
296296
foreach ($this->gateway->getDefaultParameters() as $key => $default) {
297297
// set property on gateway
298298
$getter = 'get'.ucfirst($key);
@@ -301,15 +301,15 @@ public function testStoreParameters()
301301
$this->gateway->$setter($value);
302302

303303
// request should have matching property, with correct value
304-
$request = $this->gateway->store();
304+
$request = $this->gateway->create();
305305
$this->assertSame($value, $request->$getter());
306306
}
307307
}
308308
}
309309

310-
public function testUnstoreParameters()
310+
public function testDeleteParameters()
311311
{
312-
if ($this->gateway->supportsUnstore()) {
312+
if ($this->gateway->supportsDelete()) {
313313
foreach ($this->gateway->getDefaultParameters() as $key => $default) {
314314
// set property on gateway
315315
$getter = 'get'.ucfirst($key);
@@ -318,7 +318,7 @@ public function testUnstoreParameters()
318318
$this->gateway->$setter($value);
319319

320320
// request should have matching property, with correct value
321-
$request = $this->gateway->unstore();
321+
$request = $this->gateway->delete();
322322
$this->assertSame($value, $request->$getter());
323323
}
324324
}

0 commit comments

Comments
 (0)