Skip to content

Commit 95e843e

Browse files
committed
Update PHPUnit
- flip missordered arguments - remove ->expects($this->any()) without special meaning - XML config: remove redundant default value, remove outdated comment, update schema location
1 parent 129ba50 commit 95e843e

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

phpunit.xml.dist

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<!-- http://phpunit.de/manual/4.1/en/appendixes.configuration.html -->
43
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
6-
backupGlobals="false"
4+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/8.5/phpunit.xsd"
75
bootstrap="vendor/autoload.php"
86
>
97
<testsuites>
@@ -17,5 +15,4 @@
1715
<directory>src</directory>
1816
</whitelist>
1917
</filter>
20-
21-
</phpunit>
18+
</phpunit>

test/Webfactory/Slimdump/Config/TableTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public function testDumpTriggerDefaultSetting()
129129
$xmlElement = new \SimpleXMLElement($xml);
130130
$table = new Table($xmlElement);
131131

132-
$this->assertEquals($table->getDumpTriggersLevel(), Table::DEFINER_NO_DEFINER);
132+
$this->assertEquals(Table::DEFINER_NO_DEFINER, $table->getDumpTriggersLevel());
133133
$this->assertTrue($table->isTriggerDumpRequired());
134134
}
135135

test/Webfactory/Slimdump/Database/DumperTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function setUp(): void
3333

3434
public function testDumpSchemaWithNormalConfiguration()
3535
{
36-
$this->dbMock->expects($this->any())->method('fetchColumn')->willReturn('CREATE TABLE statement');
36+
$this->dbMock->method('fetchColumn')->willReturn('CREATE TABLE statement');
3737

3838
$this->dumper->dumpSchema('test', $this->dbMock);
3939
$output = $this->outputBuffer->fetch();
@@ -46,12 +46,12 @@ public function testDumpDataWithFullConfiguration()
4646
{
4747
$pdoMock = $this->getMockBuilder(\stdClass::class)->addMethods(['setAttribute'])->getMock();
4848

49-
$this->dbMock->expects($this->any())->method('getWrappedConnection')->willReturn($pdoMock);
49+
$this->dbMock->method('getWrappedConnection')->willReturn($pdoMock);
5050

51-
$this->dbMock->expects($this->any())
51+
$this->dbMock
5252
->method('fetchColumn')
5353
->willReturn(2);
54-
$this->dbMock->expects($this->any())
54+
$this->dbMock
5555
->method('fetchAll')
5656
->willReturnCallback(function ($query) {
5757
if (false !== strpos($query, 'SHOW COLUMNS')) {
@@ -69,13 +69,13 @@ public function testDumpDataWithFullConfiguration()
6969

7070
throw new \RuntimeException('Unexpected fetchAll-call: '.$query);
7171
});
72-
$this->dbMock->expects($this->any())
72+
$this->dbMock
7373
->method('quote')
7474
->willReturnCallback(function ($value) {
7575
return $value;
7676
});
7777

78-
$this->dbMock->expects($this->any())->method('query')->willReturn([
78+
$this->dbMock->method('query')->willReturn([
7979
[
8080
'col1' => 'value1.1',
8181
'col2' => 'value1.2',

0 commit comments

Comments
 (0)