Fork me on GitHub
a Sensio Labs Product

Folding Bike (v3.91.3) edition

Rule php_unit_assert_new_names

Rename deprecated PHPUnit assertions like assertFileNotExists to new methods like assertFileDoesNotExist.

Warning

This rule is RISKY

Fixer could be risky if one is overriding PHPUnit’s native methods.

Examples

Example #1

--- Original
+++ New
 <?php
 final class MyTest extends \PHPUnit_Framework_TestCase
 {
     public function testSomeTest()
     {
-        $this->assertFileNotExists("test.php");
-        $this->assertNotIsWritable("path.php");
+        $this->assertFileDoesNotExist("test.php");
+        $this->assertIsNotWritable("path.php");
     }
 }

Rule sets

The rule is part of the following rule sets:

References

The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.