| 1 | <?php |
||
| 8 | class UriPartTestCase extends \PHPUnit_Framework_TestCase |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Asserts that the given expected string is the same as the string returned by an object instance's __toString |
||
| 12 | * magic method. |
||
| 13 | * |
||
| 14 | * @throws \PHPUnit_Framework_ExpectationFailedException provided an instance of an object with no __toString |
||
| 15 | * method. |
||
| 16 | * |
||
| 17 | * @param string $expected |
||
| 18 | * @param object $test_instance |
||
| 19 | */ |
||
| 20 | 10 | public static function assertSameAsToString($expected, $test_instance) |
|
| 29 | |||
| 30 | /** |
||
| 31 | * Tests whether the constructor of a given class throws an \InvalidArgumentException when attempting to construct |
||
| 32 | * an instance with a non-string. |
||
| 33 | * |
||
| 34 | * @param string $class_name The name of the class to test |
||
| 35 | * @param string $data Data to be passed to the class's constructor |
||
| 36 | * @param string|null $message [optional] The expected \InvalidArgumentException message |
||
| 37 | */ |
||
| 38 | 21 | public function expectInvalidArgumentExceptionGivenNonString($class_name, $data, $message = null) |
|
| 51 | } |
||
| 52 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.