Calling disableWarnings() methods sets the private variable _warningsEnabled to false which is used in _getWarnings() to determine whether the warning should be displayed. Since _getWarnings() is a private method you have called getDisplay() method which in turn calls _getWarnings() method. Although this works this is not the preferred way of testing functions. See https://github.com/phpmyadmin/phpmyadmin/blob/a9d57ee529b0f187d54a809139594da9b102fd2c/test/classes/PMA_Header_test.php#L157 for the improvements I have made.

To test the disableWarnings() method you can call it in the test case and check whether _warningsEnabled variable is set properly. If we take the _getWarnings() method, we can check whether it correctly avoids warnings when warnings are disabled. We can straight away use disableWarnings() method as it has already been tested (see @depends directive). To test private methods use ReflectionMethod class. Here is a good read about the same. http://sebastian-bergmann.de/archives/881-Testing-Your-Privates.html