Skip to content

Commit 0333890

Browse files
committed
Adding void types for PHPUnit 8
1 parent a862e9f commit 0333890

22 files changed

+276
-276
lines changed

tests/AlterableResultIteratorTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class AlterableResultIteratorTest extends TestCase
1010
{
11-
public function testUnalteredResultSet()
11+
public function testUnalteredResultSet(): void
1212
{
1313
$a = (object) ['a' => 'a'];
1414
$b = (object) ['b' => 'c'];
@@ -26,7 +26,7 @@ public function testUnalteredResultSet()
2626
$this->assertEquals($a, $alterableResultIterator->first());
2727
}
2828

29-
public function testEmptyResultSet()
29+
public function testEmptyResultSet(): void
3030
{
3131
$alterableResultIterator = new AlterableResultIterator();
3232

@@ -36,7 +36,7 @@ public function testEmptyResultSet()
3636
$this->assertNull($alterableResultIterator->first());
3737
}
3838

39-
public function testAlterEmptyResultSet()
39+
public function testAlterEmptyResultSet(): void
4040
{
4141
$alterableResultIterator = new AlterableResultIterator();
4242

@@ -52,7 +52,7 @@ public function testAlterEmptyResultSet()
5252
$this->assertEquals([$a], $alterableResultIterator->toArray());
5353
}
5454

55-
public function testAlterFilledResultSet()
55+
public function testAlterFilledResultSet(): void
5656
{
5757
$a = (object) ['a' => 'a'];
5858
$b = (object) ['b' => 'c'];
@@ -69,7 +69,7 @@ public function testAlterFilledResultSet()
6969
$this->assertEquals([$c], iterator_to_array($alterableResultIterator->take(1, 1)));
7070
}
7171

72-
public function testAddAfterToArray()
72+
public function testAddAfterToArray(): void
7373
{
7474
$a = (object) ['a' => 'a'];
7575
$b = (object) ['b' => 'c'];
@@ -87,7 +87,7 @@ public function testAddAfterToArray()
8787
$this->assertEquals([$a, $c], $alterableResultIterator->toArray());
8888
}
8989

90-
public function testGetIterator()
90+
public function testGetIterator(): void
9191
{
9292
$a = (object) ['a' => 'a'];
9393
$b = (object) ['b' => 'c'];
@@ -106,21 +106,21 @@ public function testGetIterator()
106106
$this->assertInstanceOf(\ArrayIterator::class, $alterableResultIterator->getIterator());
107107
}
108108

109-
public function testSetException()
109+
public function testSetException(): void
110110
{
111111
$alterableResultIterator = new AlterableResultIterator();
112112
$this->expectException(TDBMInvalidOperationException::class);
113113
$alterableResultIterator[0] = 'foo';
114114
}
115115

116-
public function testUnsetException()
116+
public function testUnsetException(): void
117117
{
118118
$alterableResultIterator = new AlterableResultIterator();
119119
$this->expectException(TDBMInvalidOperationException::class);
120120
unset($alterableResultIterator[0]);
121121
}
122122

123-
public function testMap()
123+
public function testMap(): void
124124
{
125125
$a = (object) ['foo' => 'bar'];
126126

@@ -135,7 +135,7 @@ public function testMap()
135135
$this->assertEquals(['bar'], iterator_to_array($map));
136136
}
137137

138-
public function testSetIterator()
138+
public function testSetIterator(): void
139139
{
140140
$alterableResultIterator = new AlterableResultIterator();
141141

tests/Commands/AlteredConfigurationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
class AlteredConfigurationTest extends TestCase
1616
{
17-
public function testAlteredConfiguration()
17+
public function testAlteredConfiguration(): void
1818
{
1919
$connection = $this->getMockBuilder(Connection::class)->disableOriginalConstructor()->getMock();
2020
$namingStrategy = $this->getMockBuilder(NamingStrategyInterface::class)->disableOriginalConstructor()->getMock();

tests/Commands/GenerateCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public static function getInputDefinition()
1919
]);
2020
}
2121

22-
public function testCall()
22+
public function testCall(): void
2323
{
2424
$input = new ArrayInput([
2525
], self::getInputDefinition());

tests/MapIteratorTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class MapIteratorTest extends TestCase
2828
/**
2929
* @expectedException \TheCodingMachine\TDBM\TDBMException
3030
*/
31-
public function testConstructorException1()
31+
public function testConstructorException1(): void
3232
{
3333
$mapIterator = new MapIterator(new \DateTime(), function ($item) {
3434
return $item;
@@ -38,14 +38,14 @@ public function testConstructorException1()
3838
/**
3939
* @expectedException \TheCodingMachine\TDBM\TDBMException
4040
*/
41-
public function testConstructorException2()
41+
public function testConstructorException2(): void
4242
{
4343
$mapIterator = new MapIterator(array(1, 2, 3), function () {
4444
return $item;
4545
});
4646
}
4747

48-
public function testJsonSerialize()
48+
public function testJsonSerialize(): void
4949
{
5050
$value = array(1, 2, 3);
5151
$mapIterator = new MapIterator($value, function ($item) {

tests/OrderByAnalyzerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class OrderByAnalyzerTest extends TestCase
1111
{
12-
public function testAnalyzeOrderBy()
12+
public function testAnalyzeOrderBy(): void
1313
{
1414
$analyzer = new OrderByAnalyzer(new VoidCache(), '');
1515
$results = $analyzer->analyzeOrderBy('`a`, b desc, rand() DESC, masc, mytable.mycol');
@@ -46,7 +46,7 @@ public function testAnalyzeOrderBy()
4646
], $results[4]);
4747
}
4848

49-
public function testExprWithAsc()
49+
public function testExprWithAsc(): void
5050
{
5151
$analyzer = new OrderByAnalyzer(new VoidCache(), '');
5252
$results = $analyzer->analyzeOrderBy('foodesc + barasc');
@@ -59,7 +59,7 @@ public function testExprWithAsc()
5959
], $results[0]);
6060
}
6161

62-
public function testCache()
62+
public function testCache(): void
6363
{
6464
$analyzer = new OrderByAnalyzer(new ArrayCache(), '');
6565
$results = $analyzer->analyzeOrderBy('foo');

tests/StandardObjectStorageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class StandardObjectStorageTest extends TestCase
88
{
9-
public function testObjectStorage()
9+
public function testObjectStorage(): void
1010
{
1111
$objectStorage = new StandardObjectStorage();
1212
$this->assertNull($objectStorage->get('foo', 42));

tests/TDBMAbstractServiceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ abstract class TDBMAbstractServiceTest extends TestCase
7171
*/
7272
private $cache;
7373

74-
public static function setUpBeforeClass()
74+
public static function setUpBeforeClass(): void
7575
{
7676
self::resetConnection();
7777

@@ -189,7 +189,7 @@ protected function onlyMySql()
189189
}
190190
}
191191

192-
protected function setUp()
192+
protected function setUp(): void
193193
{
194194
$this->tdbmService = new TDBMService($this->getConfiguration());
195195
}

0 commit comments

Comments
 (0)