Skip to content

Commit 45bbb18

Browse files
committed
Fixed ImportSpecification method parameter naming.
Added test for ImportSpecification::disableCache() to complete code coverage.
1 parent 22af158 commit 45bbb18

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

src/Specification/ImportSpecification.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ final public function getProviderName()
9191
/**
9292
* Sets the provider name.
9393
*
94-
* @param string $tag Provider name.
94+
* @param string $providerName Provider name.
9595
*
9696
* @return $this
9797
*/
98-
final public function setProviderName($tag)
98+
final public function setProviderName($providerName)
9999
{
100-
$this->providerName = "$tag";
100+
$this->providerName = "$providerName";
101101

102102
return $this;
103103
}
@@ -228,6 +228,7 @@ final public function getMaxFetchAttempts()
228228
*/
229229
final public function setMaxFetchAttempts($attempts)
230230
{
231+
// TODO: Consider throwing exception instead of silently constraining bounds.
231232
$this->maxFetchAttempts = max(1, $attempts | 0);
232233

233234
return $this;

test/Unit/Porter/ImportSpecificationTest.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
use ScriptFUSION\Porter\Transform\Transformer;
88
use ScriptFUSIONTest\Stubs\Invokable;
99

10+
/**
11+
* @see ImportSpecification
12+
*/
1013
final class ImportSpecificationTest extends \PHPUnit_Framework_TestCase
1114
{
1215
/** @var ImportSpecification */
@@ -48,14 +51,14 @@ public function testClone()
4851
self::assertNotSame($handler, $specification->getFetchExceptionHandler());
4952
}
5053

51-
public function testProviderData()
54+
public function testGetResource()
5255
{
5356
self::assertSame($this->resource, $this->specification->getResource());
5457
}
5558

56-
public function testProviderTag()
59+
public function testProviderName()
5760
{
58-
self::assertSame($tag = 'foo', $this->specification->setProviderName($tag)->getProviderName());
61+
self::assertSame($name = 'foo', $this->specification->setProviderName($name)->getProviderName());
5962
}
6063

6164
public function testAddTransformer()
@@ -105,6 +108,9 @@ public function testCache()
105108

106109
$this->specification->enableCache();
107110
self::assertTrue($this->specification->mustCache());
111+
112+
$this->specification->disableCache();
113+
self::assertFalse($this->specification->mustCache());
108114
}
109115

110116
/**

0 commit comments

Comments
 (0)