Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[fixes #11012465] Replace deprecated PHPUnit features in test suite

  • Loading branch information...
commit 4adb88d78e7d5ffedfde2414e9cbb7ff241604c4 1 parent 13cb4fe
@manuelpichler manuelpichler authored
View
2  CHANGELOG
@@ -3,6 +3,8 @@ phpmd-1.1.0 (2011/03/ )
- Implemented #10474873: Add rule for PHP's goto statement. Implemented
with commit #2745a20.
+- Implemented #11012465: Replace deprecated PHPUnit features in test suite.
+ Implemented with commit #.
- Fixed #10096717: LongVariable rule should not apply on private
properties. Fixed with commit #f063bc9.
View
2  src/conf/package.xml
@@ -36,6 +36,8 @@
<notes>
- Implemented #10474873: Add rule for PHP's goto statement. Implemented
with commit #2745a20.
+- Implemented #11012465: Replace deprecated PHPUnit features in test suite.
+ Implemented with commit #.
- Fixed #10096717: LongVariable rule should not apply on private
properties. Fixed with commit #f063bc9.
</notes>
View
4 src/test/php/PHP/PMD/Node/MethodTest.php
@@ -111,7 +111,7 @@ public function testMagicCallThrowsExceptionWhenNoMatchingMethodExists()
public function testGetParentTypeReturnsInterfaceForInterfaceMethod()
{
$method = $this->getMethod();
- $this->assertType(PHP_PMD_Node_Interface::CLAZZ, $method->getParentType());
+ self::assertInstanceOf(PHP_PMD_Node_Interface::CLAZZ, $method->getParentType());
}
/**
@@ -126,7 +126,7 @@ public function testGetParentTypeReturnsInterfaceForInterfaceMethod()
public function testGetParentTypeReturnsClassForClassMethod()
{
$method = $this->getMethod();
- $this->assertType(PHP_PMD_Node_Class::CLAZZ, $method->getParentType());
+ self::assertInstanceOf(PHP_PMD_Node_Class::CLAZZ, $method->getParentType());
}
/**
View
1  src/test/php/PHP/PMD/ReportTest.php
@@ -83,7 +83,6 @@ public function testReportReturnsAListWithAllRuleViolations()
$actual = array();
foreach ($report->getRuleViolations() as $violation) {
- $this->assertType('PHP_PMD_RuleViolation', $violation);
$actual[] = $violation->getFileName();
}
View
14 src/test/php/PHP/PMD/RuleSetFactoryTest.php
@@ -107,7 +107,7 @@ public function testCreateRuleSetFileNameFindsXmlFileInCurrentWorkingDirectory()
public function testCreateRuleSetsReturnsArray()
{
$ruleSets = $this->_createRuleSetsFromAbsoluteFiles('rulesets/set1.xml');
- $this->assertType('array', $ruleSets);
+ self::assertInternalType('array', $ruleSets);
}
/**
@@ -135,7 +135,7 @@ public function testCreateRuleSetsForSingleFileReturnsArrayWithOneElement()
public function testCreateRuleSetsForSingleFileReturnsOneRuleSetInstance()
{
$ruleSets = $this->_createRuleSetsFromAbsoluteFiles('rulesets/set1.xml');
- $this->assertType('PHP_PMD_RuleSet', $ruleSets[0]);
+ self::assertInstanceOf('PHP_PMD_RuleSet', $ruleSets[0]);
}
/**
@@ -197,8 +197,8 @@ public function testCreateRuleSetsForTwoFilesReturnsExpectedRuleSetInstances()
'rulesets/set1.xml',
'rulesets/set2.xml'
);
- $this->assertType('PHP_PMD_RuleSet', $ruleSets[0]);
- $this->assertType('PHP_PMD_RuleSet', $ruleSets[1]);
+ self::assertInstanceOf('PHP_PMD_RuleSet', $ruleSets[0]);
+ self::assertInstanceOf('PHP_PMD_RuleSet', $ruleSets[1]);
}
/**
@@ -250,7 +250,7 @@ public function testCreateRuleSetsForLocalFileNameReturnsArray()
self::changeWorkingDirectory();
$ruleSets = $this->_createRuleSetsFromFiles('rulesets/set1.xml');
- $this->assertType('array', $ruleSets);
+ self::assertInternalType('array', $ruleSets);
}
/**
@@ -330,7 +330,7 @@ public function testCreateRuleSetsWithReferenceContainsRuleInstances()
self::changeWorkingDirectory();
$ruleSets = $this->_createRuleSetsFromAbsoluteFiles('rulesets/refset1.xml');
- $this->assertType('PHP_PMD_AbstractRule', $ruleSets[0]->getRules()->current());
+ self::assertInstanceOf('PHP_PMD_AbstractRule', $ruleSets[0]->getRules()->current());
}
/**
@@ -372,7 +372,7 @@ public function testCreateSingleRuleSetReturnsRuleSetInstance()
$factory = new PHP_PMD_RuleSetFactory();
$ruleSet = $factory->createSingleRuleSet('set1');
- $this->assertType('PHP_PMD_RuleSet', $ruleSet);
+ self::assertInstanceOf('PHP_PMD_RuleSet', $ruleSet);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.