Skip to content

Commit 4adb88d

Browse files
committed
[fixes #11012465] Replace deprecated PHPUnit features in test suite
1 parent 13cb4fe commit 4adb88d

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ phpmd-1.1.0 (2011/03/ )
33

44
- Implemented #10474873: Add rule for PHP's goto statement. Implemented
55
with commit #2745a20.
6+
- Implemented #11012465: Replace deprecated PHPUnit features in test suite.
7+
Implemented with commit #.
68
- Fixed #10096717: LongVariable rule should not apply on private
79
properties. Fixed with commit #f063bc9.
810

src/conf/package.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
<notes>
3737
- Implemented #10474873: Add rule for PHP's goto statement. Implemented
3838
with commit #2745a20.
39+
- Implemented #11012465: Replace deprecated PHPUnit features in test suite.
40+
Implemented with commit #.
3941
- Fixed #10096717: LongVariable rule should not apply on private
4042
properties. Fixed with commit #f063bc9.
4143
</notes>

src/test/php/PHP/PMD/Node/MethodTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function testMagicCallThrowsExceptionWhenNoMatchingMethodExists()
111111
public function testGetParentTypeReturnsInterfaceForInterfaceMethod()
112112
{
113113
$method = $this->getMethod();
114-
$this->assertType(PHP_PMD_Node_Interface::CLAZZ, $method->getParentType());
114+
self::assertInstanceOf(PHP_PMD_Node_Interface::CLAZZ, $method->getParentType());
115115
}
116116

117117
/**
@@ -126,7 +126,7 @@ public function testGetParentTypeReturnsInterfaceForInterfaceMethod()
126126
public function testGetParentTypeReturnsClassForClassMethod()
127127
{
128128
$method = $this->getMethod();
129-
$this->assertType(PHP_PMD_Node_Class::CLAZZ, $method->getParentType());
129+
self::assertInstanceOf(PHP_PMD_Node_Class::CLAZZ, $method->getParentType());
130130
}
131131

132132
/**

src/test/php/PHP/PMD/ReportTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ public function testReportReturnsAListWithAllRuleViolations()
8383

8484
$actual = array();
8585
foreach ($report->getRuleViolations() as $violation) {
86-
$this->assertType('PHP_PMD_RuleViolation', $violation);
8786
$actual[] = $violation->getFileName();
8887
}
8988

src/test/php/PHP/PMD/RuleSetFactoryTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function testCreateRuleSetFileNameFindsXmlFileInCurrentWorkingDirectory()
107107
public function testCreateRuleSetsReturnsArray()
108108
{
109109
$ruleSets = $this->_createRuleSetsFromAbsoluteFiles('rulesets/set1.xml');
110-
$this->assertType('array', $ruleSets);
110+
self::assertInternalType('array', $ruleSets);
111111
}
112112

113113
/**
@@ -135,7 +135,7 @@ public function testCreateRuleSetsForSingleFileReturnsArrayWithOneElement()
135135
public function testCreateRuleSetsForSingleFileReturnsOneRuleSetInstance()
136136
{
137137
$ruleSets = $this->_createRuleSetsFromAbsoluteFiles('rulesets/set1.xml');
138-
$this->assertType('PHP_PMD_RuleSet', $ruleSets[0]);
138+
self::assertInstanceOf('PHP_PMD_RuleSet', $ruleSets[0]);
139139
}
140140

141141
/**
@@ -197,8 +197,8 @@ public function testCreateRuleSetsForTwoFilesReturnsExpectedRuleSetInstances()
197197
'rulesets/set1.xml',
198198
'rulesets/set2.xml'
199199
);
200-
$this->assertType('PHP_PMD_RuleSet', $ruleSets[0]);
201-
$this->assertType('PHP_PMD_RuleSet', $ruleSets[1]);
200+
self::assertInstanceOf('PHP_PMD_RuleSet', $ruleSets[0]);
201+
self::assertInstanceOf('PHP_PMD_RuleSet', $ruleSets[1]);
202202
}
203203

204204
/**
@@ -250,7 +250,7 @@ public function testCreateRuleSetsForLocalFileNameReturnsArray()
250250
self::changeWorkingDirectory();
251251

252252
$ruleSets = $this->_createRuleSetsFromFiles('rulesets/set1.xml');
253-
$this->assertType('array', $ruleSets);
253+
self::assertInternalType('array', $ruleSets);
254254
}
255255

256256
/**
@@ -330,7 +330,7 @@ public function testCreateRuleSetsWithReferenceContainsRuleInstances()
330330
self::changeWorkingDirectory();
331331

332332
$ruleSets = $this->_createRuleSetsFromAbsoluteFiles('rulesets/refset1.xml');
333-
$this->assertType('PHP_PMD_AbstractRule', $ruleSets[0]->getRules()->current());
333+
self::assertInstanceOf('PHP_PMD_AbstractRule', $ruleSets[0]->getRules()->current());
334334
}
335335

336336
/**
@@ -372,7 +372,7 @@ public function testCreateSingleRuleSetReturnsRuleSetInstance()
372372
$factory = new PHP_PMD_RuleSetFactory();
373373
$ruleSet = $factory->createSingleRuleSet('set1');
374374

375-
$this->assertType('PHP_PMD_RuleSet', $ruleSet);
375+
self::assertInstanceOf('PHP_PMD_RuleSet', $ruleSet);
376376
}
377377

378378
/**

0 commit comments

Comments
 (0)