Skip to content

Commit 5a1e082

Browse files
thiemowmdeJeroenDeDauw
authored andcommitted
Remove all deprecated class aliases (#657)
* Remove all deprecated class aliases * Skip AutoloadingAliasesTest
1 parent 92ad775 commit 5a1e082

7 files changed

Lines changed: 7 additions & 39 deletions

File tree

Aliases.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,3 @@
55
// Actual aliasing happens in the entry point using class_alias.
66

77
namespace { throw new Exception( 'This code is not meant to be executed' ); }
8-
9-
namespace Wikibase\DataModel\Claim {
10-
11-
/**
12-
* @deprecated since 3.0.0, use the base class instead.
13-
*/
14-
class Claim extends \Wikibase\DataModel\Statement\Statement {}
15-
16-
/**
17-
* @deprecated since 3.0.0, use the base class instead.
18-
*/
19-
class ClaimGuid extends \Wikibase\DataModel\Statement\StatementGuid {}
20-
21-
}
22-
23-
namespace Wikibase\DataModel {
24-
25-
/**
26-
* @deprecated since 3.0.0, use the base interface instead.
27-
*/
28-
interface StatementListProvider extends \Wikibase\DataModel\Statement\StatementListProvider {}
29-
30-
}

WikibaseDataModel.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,3 @@
1212
if ( defined( 'MEDIAWIKI' ) && function_exists( 'wfLoadExtension' ) ) {
1313
wfLoadExtension( 'WikibaseDataModel', __DIR__ . '/mediawiki-extension.json' );
1414
}
15-
16-
// Aliases introduced in 3.0.0
17-
class_alias( 'Wikibase\DataModel\Statement\Statement', 'Wikibase\DataModel\Claim\Claim' );
18-
class_alias( 'Wikibase\DataModel\Statement\StatementGuid', 'Wikibase\DataModel\Claim\ClaimGuid' );
19-
class_alias( 'Wikibase\DataModel\Statement\StatementListProvider', 'Wikibase\DataModel\StatementListProvider' );

tests/component/AutoloadingAliasesTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ class AutoloadingAliasesTest extends \PHPUnit_Framework_TestCase {
1111
/**
1212
* @dataProvider oldNameProvider
1313
*/
14-
public function testAliasExists( $className ) {
14+
public function testAliasExists( /* $className */ ) {
15+
$this->markTestSkipped( 'No class aliases at the moment' );
16+
1517
$this->assertTrue(
1618
class_exists( $className ) || interface_exists( $className ),
1719
'Class name "' . $className . '" should still exist as alias'
@@ -21,9 +23,6 @@ class_exists( $className ) || interface_exists( $className ),
2123
public function oldNameProvider() {
2224
return [
2325
// Full qualified aliases go here.
24-
[ 'Wikibase\DataModel\Claim\Claim' ],
25-
[ 'Wikibase\DataModel\Claim\ClaimGuid' ],
26-
[ 'Wikibase\DataModel\StatementListProvider' ],
2726
];
2827
}
2928

tests/unit/Entity/ItemTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
* @covers Wikibase\DataModel\Entity\Item
2121
*
2222
* @group Wikibase
23-
* @group WikibaseItem
2423
* @group WikibaseDataModel
2524
*
2625
* @license GPL-2.0+

tests/unit/Entity/PropertyTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
* @covers Wikibase\DataModel\Entity\Property
2121
*
2222
* @group Wikibase
23-
* @group WikibaseProperty
2423
* @group WikibaseDataModel
2524
*
2625
* @license GPL-2.0+

tests/unit/Statement/StatementByGuidMapTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
class StatementByGuidMapTest extends \PHPUnit_Framework_TestCase {
1818

19-
public function testGivenNotPresentGuid_hasClaimWithGuidReturnsFalse() {
19+
public function testGivenNotPresentGuid_hasStatementWithGuidReturnsFalse() {
2020
$statements = new StatementByGuidMap();
2121

2222
$this->assertFalse( $statements->hasStatementWithGuid( 'some guid' ) );
@@ -40,7 +40,7 @@ private function newStatement( $propertyId, $guid ) {
4040
/**
4141
* @dataProvider nonStringProvider
4242
*/
43-
public function testGivenNonStringGuid_hasClaimWithGuidThrowsException( $nonString ) {
43+
public function testGivenNonStringGuid_hasStatementWithGuidThrowsException( $nonString ) {
4444
$statements = new StatementByGuidMap();
4545

4646
$this->setExpectedException( 'InvalidArgumentException' );

tests/unit/Statement/StatementTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
*
2020
* @group Wikibase
2121
* @group WikibaseDataModel
22-
* @group WikibaseStatement
2322
*
2423
* @license GPL-2.0+
2524
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
@@ -317,7 +316,7 @@ public function testGivenStatementWithDifferentSnakType_equalsReturnsFalse() {
317316
$this->assertFalse( $statement->equals( new Statement( new PropertySomeValueSnak( 42 ) ) ) );
318317
}
319318

320-
public function testStatementClaimWithDifferentQualifiers_equalsReturnsFalse() {
319+
public function testStatementWithDifferentQualifiers_equalsReturnsFalse() {
321320
$statement = new Statement(
322321
new PropertyNoValueSnak( 42 ),
323322
new SnakList( [
@@ -344,7 +343,7 @@ public function testGivenStatementWithDifferentGuids_equalsReturnsFalse() {
344343
$this->assertFalse( $statement->equals( $differentStatement ) );
345344
}
346345

347-
public function testStatementClaimWithDifferentReferences_equalsReturnsFalse() {
346+
public function testStatementWithDifferentReferences_equalsReturnsFalse() {
348347
$statement = new Statement(
349348
new PropertyNoValueSnak( 42 ),
350349
new SnakList(),

0 commit comments

Comments
 (0)