Skip to content

Commit bcc928d

Browse files
authored
Merge pull request #790 from wmde/php
Drop PHP 5.5 support
2 parents 10db9b6 + 7c93a5a commit bcc928d

27 files changed

Lines changed: 65 additions & 75 deletions

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ language: php
33
dist: trusty
44

55
php:
6-
- 5.5
76
- 5.6
87
- 7.0
98
- 7.1

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
"irc": "irc://irc.freenode.net/wikidata"
2424
},
2525
"require": {
26-
"php": ">=5.5.9",
26+
"php": ">=5.6",
2727
"data-values/data-values": "~0.1|~1.0|~2.0",
2828
"wikimedia/assert": "~0.2.2"
2929
},
3030
"require-dev": {
31-
"ockcyp/covers-validator": "~0.4.0",
32-
"phpmd/phpmd": "~2.3",
33-
"phpunit/phpunit": "~4.8",
31+
"ockcyp/covers-validator": "~0.5.0",
32+
"phpmd/phpmd": "~2.6",
33+
"phpunit/phpunit": "~5.7",
3434
"wikibase/wikibase-codesniffer": "^0.3.0"
3535
},
3636
"autoload": {

tests/unit/Assert/RepositoryNameAssertTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function provideInvalidRepositoryNames() {
3333
* @dataProvider provideInvalidRepositoryNames
3434
*/
3535
public function testGivenInvalidValue_assertParameterIsValidRepositoryNameFails( $value ) {
36-
$this->setExpectedException( ParameterAssertionException::class );
36+
$this->expectException( ParameterAssertionException::class );
3737
RepositoryNameAssert::assertParameterIsValidRepositoryName( $value, 'test' );
3838
}
3939

@@ -66,7 +66,7 @@ public function provideInvalidRepositoryNameIndexedArrays() {
6666
* @dataProvider provideInvalidRepositoryNameIndexedArrays
6767
*/
6868
public function testGivenInvalidValue_assertParameterKeysAreValidRepositoryNamesFails( $values ) {
69-
$this->setExpectedException( ParameterAssertionException::class );
69+
$this->expectException( ParameterAssertionException::class );
7070
RepositoryNameAssert::assertParameterKeysAreValidRepositoryNames( $values, 'test' );
7171
}
7272

tests/unit/ByPropertyIdArrayTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testGivenNonTraversableObject_constructorDoesNotCastObjectToArra
4242
$object = new stdClass();
4343
$object->property = true;
4444

45-
$this->setExpectedException( InvalidArgumentException::class );
45+
$this->expectException( InvalidArgumentException::class );
4646
new ByPropertyIdArray( $object );
4747
}
4848

@@ -212,22 +212,22 @@ public function testGetByNotSetIdThrowsException() {
212212
$indexedArray = new ByPropertyIdArray();
213213
$indexedArray->buildIndex();
214214

215-
$this->setExpectedException( OutOfBoundsException::class );
215+
$this->expectException( OutOfBoundsException::class );
216216

217217
$indexedArray->getByPropertyId( new PropertyId( 'P9000' ) );
218218
}
219219

220220
public function testNotBuildExceptionIsThrownForByPropertyId() {
221221
$indexedArray = new ByPropertyIdArray();
222222

223-
$this->setExpectedException( RuntimeException::class );
223+
$this->expectException( RuntimeException::class );
224224
$indexedArray->getByPropertyId( new PropertyId( 'P9000' ) );
225225
}
226226

227227
public function testNotBuildExceptionIsThrownForGetPropertyIds() {
228228
$indexedArray = new ByPropertyIdArray();
229229

230-
$this->setExpectedException( RuntimeException::class );
230+
$this->expectException( RuntimeException::class );
231231
$indexedArray->getPropertyIds();
232232
}
233233

@@ -344,7 +344,7 @@ public function testMoveThrowingOutOfBoundsExceptionIfObjectNotPresent() {
344344
$indexedArray = new ByPropertyIdArray( $statements );
345345
$indexedArray->buildIndex();
346346

347-
$this->setExpectedException( OutOfBoundsException::class );
347+
$this->expectException( OutOfBoundsException::class );
348348

349349
$indexedArray->moveObjectToIndex( new Statement( new PropertyNoValueSnak( new PropertyId( 'P9999' ) ) ), 0 );
350350
}
@@ -354,7 +354,7 @@ public function testMoveThrowingOutOfBoundsExceptionOnInvalidIndex() {
354354
$indexedArray = new ByPropertyIdArray( $statements );
355355
$indexedArray->buildIndex();
356356

357-
$this->setExpectedException( OutOfBoundsException::class );
357+
$this->expectException( OutOfBoundsException::class );
358358

359359
$indexedArray->moveObjectToIndex( $statements[0], 9999 );
360360
}

tests/unit/Entity/BasicEntityIdParserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function entityIdProvider() {
4242
public function testCannotParseInvalidId( $invalidIdSerialization ) {
4343
$parser = new BasicEntityIdParser();
4444

45-
$this->setExpectedException( EntityIdParsingException::class );
45+
$this->expectException( EntityIdParsingException::class );
4646
$parser->parse( $invalidIdSerialization );
4747
}
4848

tests/unit/Entity/DispatchingEntityIdParserTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function entityIdProvider() {
5151
public function testCannotParseInvalidId( $invalidIdSerialization ) {
5252
$parser = $this->getBasicParser();
5353

54-
$this->setExpectedException( EntityIdParsingException::class );
54+
$this->expectException( EntityIdParsingException::class );
5555
$parser->parse( $invalidIdSerialization );
5656
}
5757

@@ -75,7 +75,7 @@ public function invalidIdSerializationProvider() {
7575
public function testCannotParseWithoutBuilders() {
7676
$parser = new DispatchingEntityIdParser( [] );
7777

78-
$this->setExpectedException( EntityIdParsingException::class );
78+
$this->expectException( EntityIdParsingException::class );
7979
$parser->parse( 'Q1' );
8080
}
8181

tests/unit/Entity/EntityIdTest.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function testSplitSerialization( $serialization, $split ) {
120120
* @dataProvider invalidSerializationProvider
121121
*/
122122
public function testSplitSerializationFails_GivenInvalidSerialization( $serialization ) {
123-
$this->setExpectedException( InvalidArgumentException::class );
123+
$this->expectException( InvalidArgumentException::class );
124124
EntityId::splitSerialization( $serialization );
125125
}
126126

@@ -135,7 +135,7 @@ public function testJoinSerialization( $serialization, $split ) {
135135
* @dataProvider invalidJoinSerializationDataProvider
136136
*/
137137
public function testJoinSerializationFails_GivenEmptyId( $parts ) {
138-
$this->setExpectedException( InvalidArgumentException::class );
138+
$this->expectException( InvalidArgumentException::class );
139139
EntityId::joinSerialization( $parts );
140140
}
141141

@@ -184,13 +184,11 @@ public function invalidSerializationProvider() {
184184
* @dataProvider invalidSerializationProvider
185185
*/
186186
public function testConstructor( $serialization ) {
187-
$this->setExpectedException( InvalidArgumentException::class );
188-
189-
$mock = $this->getMockBuilder( EntityId::class )
190-
->disableOriginalConstructor()
191-
->getMockForAbstractClass();
187+
$mock = $this->createMock( EntityId::class );
192188

193189
$constructor = ( new ReflectionClass( EntityId::class ) )->getConstructor();
190+
191+
$this->expectException( InvalidArgumentException::class );
194192
$constructor->invoke( $mock, $serialization );
195193
}
196194

tests/unit/Entity/EntityIdValueTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public function validArrayProvider() {
199199
* @dataProvider invalidArrayProvider
200200
*/
201201
public function testCannotDeserializeInvalidSerialization( $invalidArray ) {
202-
$this->setExpectedException( IllegalValueException::class );
202+
$this->expectException( IllegalValueException::class );
203203

204204
EntityIdValue::newFromArray( $invalidArray );
205205
}

tests/unit/Entity/EntityRedirectTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function testConstruction() {
2929
}
3030

3131
public function testConstruction_baseType() {
32-
$this->setExpectedException( InvalidArgumentException::class );
32+
$this->expectException( InvalidArgumentException::class );
3333

3434
$entityId = new ItemId( 'Q123' );
3535
$targetId = new PropertyId( 'P345' );

tests/unit/Entity/ItemIdParserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function entityIdProvider() {
3838
public function testCannotParseInvalidId( $invalidIdSerialization ) {
3939
$parser = new ItemIdParser();
4040

41-
$this->setExpectedException( EntityIdParsingException::class );
41+
$this->expectException( EntityIdParsingException::class );
4242
$parser->parse( $invalidIdSerialization );
4343
}
4444

0 commit comments

Comments
 (0)