Zug*_*alt 4 php phpunit error-log
当error_log()从PHPUnit的内部运行不写正常的错误日志文件。我想停止它,以便它写入文件,就像我通过浏览器点击 PHP 一样。
<?php
class exampleTest extends PHPUnit_Framework_TestCase {
public function testSomething() {
error_log('This will not be written to the error log, but I wish it was!');
$this->assertEquals(2, 1+1);
}
}
Run Code Online (Sandbox Code Playgroud)
我目前使用 php 5.5 版,phpunit 3.7 版。这在 osx 和 ubunutu 上都会发生。这在 Windows 7 上不会发生。