Skip to content

PHPUnit

在终端数据调试信息

php
fwrite(STDERR, print_r($OSS_URI, TRUE));

测试某个方法

php
require_once __DIR__ . '/the.php';

final class ThePHPTest extends TestCase
{
    public function testCase1()
    {
        $this->run('ab c', 'abc');
    }

    public function testCase2()
    {
        $this->run('ab  c', 'abc');
    }

    public function run($string, $except)
    {
        // remove space
        the_func_in_the_php($string);
        $this->assertSame($except, $string);
    }
}

彩雲博客