Skip to content
This repository
Browse code

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

  • Loading branch information...
commit 4adb88d78e7d5ffedfde2414e9cbb7ff241604c4 1 parent 13cb4fe
Manuel Pichler authored March 13, 2011
2  CHANGELOG
@@ -3,6 +3,8 @@ phpmd-1.1.0 (2011/03/  )
3 3
 
4 4
 - Implemented #10474873: Add rule for PHP's goto statement. Implemented
5 5
   with commit #2745a20.
  6
+- Implemented #11012465: Replace deprecated PHPUnit features in test suite.
  7
+  Implemented with commit #.
6 8
 - Fixed #10096717: LongVariable rule should not apply on private
7 9
   properties. Fixed with commit #f063bc9.
8 10
 
2  src/conf/package.xml
@@ -36,6 +36,8 @@
36 36
     <notes>
37 37
 - Implemented #10474873: Add rule for PHP's goto statement. Implemented
38 38
   with commit #2745a20.
  39
+- Implemented #11012465: Replace deprecated PHPUnit features in test suite.
  40
+  Implemented with commit #.
39 41
 - Fixed #10096717: LongVariable rule should not apply on private
40 42
   properties. Fixed with commit #f063bc9.
41 43
     </notes>
4  src/test/php/PHP/PMD/Node/MethodTest.php
@@ -111,7 +111,7 @@ public function testMagicCallThrowsExceptionWhenNoMatchingMethodExists()
111 111
     public function testGetParentTypeReturnsInterfaceForInterfaceMethod()
112 112
     {
113 113
         $method = $this->getMethod();
114  
-        $this->assertType(PHP_PMD_Node_Interface::CLAZZ, $method->getParentType());
  114
+        self::assertInstanceOf(PHP_PMD_Node_Interface::CLAZZ, $method->getParentType());
115 115
     }
116 116
 
117 117
     /**
@@ -126,7 +126,7 @@ public function testGetParentTypeReturnsInterfaceForInterfaceMethod()
126 126
     public function testGetParentTypeReturnsClassForClassMethod()
127 127
     {
128 128
         $method = $this->getMethod();
129  
-        $this->assertType(PHP_PMD_Node_Class::CLAZZ, $method->getParentType());
  129
+        self::assertInstanceOf(PHP_PMD_Node_Class::CLAZZ, $method->getParentType());
130 130
     }
131 131
 
132 132
     /**
1  src/test/php/PHP/PMD/ReportTest.php
@@ -83,7 +83,6 @@ public function testReportReturnsAListWithAllRuleViolations()
83 83
 
84 84
         $actual = array();
85 85
         foreach ($report->getRuleViolations() as $violation) {
86  
-            $this->assertType('PHP_PMD_RuleViolation', $violation);
87 86
             $actual[] = $violation->getFileName();
88 87
         }
89 88
 
14  src/test/php/PHP/PMD/RuleSetFactoryTest.php
@@ -107,7 +107,7 @@ public function testCreateRuleSetFileNameFindsXmlFileInCurrentWorkingDirectory()
107 107
     public function testCreateRuleSetsReturnsArray()
108 108
     {
109 109
         $ruleSets = $this->_createRuleSetsFromAbsoluteFiles('rulesets/set1.xml');
110  
-        $this->assertType('array', $ruleSets);
  110
+        self::assertInternalType('array', $ruleSets);
111 111
     }
112 112
 
113 113
     /**
@@ -135,7 +135,7 @@ public function testCreateRuleSetsForSingleFileReturnsArrayWithOneElement()
135 135
     public function testCreateRuleSetsForSingleFileReturnsOneRuleSetInstance()
136 136
     {
137 137
         $ruleSets = $this->_createRuleSetsFromAbsoluteFiles('rulesets/set1.xml');
138  
-        $this->assertType('PHP_PMD_RuleSet', $ruleSets[0]);
  138
+        self::assertInstanceOf('PHP_PMD_RuleSet', $ruleSets[0]);
139 139
     }
140 140
 
141 141
     /**
@@ -197,8 +197,8 @@ public function testCreateRuleSetsForTwoFilesReturnsExpectedRuleSetInstances()
197 197
             'rulesets/set1.xml',
198 198
             'rulesets/set2.xml'
199 199
         );
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]);
202 202
     }
203 203
 
204 204
     /**
@@ -250,7 +250,7 @@ public function testCreateRuleSetsForLocalFileNameReturnsArray()
250 250
         self::changeWorkingDirectory();
251 251
         
252 252
         $ruleSets = $this->_createRuleSetsFromFiles('rulesets/set1.xml');
253  
-        $this->assertType('array', $ruleSets);
  253
+        self::assertInternalType('array', $ruleSets);
254 254
     }
255 255
 
256 256
     /**
@@ -330,7 +330,7 @@ public function testCreateRuleSetsWithReferenceContainsRuleInstances()
330 330
         self::changeWorkingDirectory();
331 331
 
332 332
         $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());
334 334
     }
335 335
 
336 336
     /**
@@ -372,7 +372,7 @@ public function testCreateSingleRuleSetReturnsRuleSetInstance()
372 372
         $factory = new PHP_PMD_RuleSetFactory();
373 373
         $ruleSet = $factory->createSingleRuleSet('set1');
374 374
         
375  
-        $this->assertType('PHP_PMD_RuleSet', $ruleSet);
  375
+        self::assertInstanceOf('PHP_PMD_RuleSet', $ruleSet);
376 376
     }
377 377
 
378 378
     /**

0 notes on commit 4adb88d

Please sign in to comment.
Something went wrong with that request. Please try again.