Question: Why does PHPUnit work in strict mode?
Problem:
PHPUnit 4.3.1 by Sebastian Bergman.
Configuration read from /full/path/to/configuration.xml
R
Time: 2.65 seconds, Memory: 11.50Mb
OK, but incomplete, missed or risky tests! Tests: 1, Approvals: 1, Risky: 1. Done.
also:
Risky test: test code or verified code did not (only) close output buffers
My PHP version is 5.4.
As stated in the documentation ( https://phpunit.de/manual/current/en/strict-mode.html ), this only applies to strict PHPUnits settings.
PHPUnit may perform additional checks when running tests. In addition to fine-grained control over various strict modes (see below), you can use the --strict command line option or set strict = "true" in the PHPUnit XML configuration file to include all of them.
-
Exit during test execution
PHPUnit can be strict regarding output during tests. This check can be by using the -disallow-test-output option on the command line or by setting beStrictAboutOutputDuringTests = "true" in the PHPUnit XML configuration file.
A test that emits output, for example, by invoking printing in a test code or a verified code, will be flagged as dangerous when this check is made.
I believe that I did not activate strict mode. My command line: "/ usr / bin / php / usr / bin / phpunit --colors --bootstrap / full / path / to / bootstrap.php --configuration / full / path / to / configuration.xml / full / path /to/Test.php ". I also used the configuration as stated in " https://phpunit.de/manual/current/en/appendixes.configuration.html .
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.3/phpunit.xsd" backupGlobals="true" backupStaticAttributes="false" cacheTokens="false" colors="false" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" forceCoversAnnotation="false" mapTestClassNameToCoveredClassName="false" printerClass="PHPUnit_TextUI_ResultPrinter" processIsolation="false" stopOnError="false" stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false" testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader" timeoutForSmallTests="1" timeoutForMediumTests="10" timeoutForLargeTests="60" strict="false" verbose="false"> </phpunit>
Earlier, I used a shorter version of this configuration, which gave the same result.
<phpunit beStrictAboutOutputDuringTests="false" strict="false" colors="false"> </phpunit>