我构建了一个 Artisan 命令来从套接字接收数据,我想为此命令编写单元测试,但我不确定如何编写这样的测试。
有人知道如何写吗?
测试示例
<?php
class YourCommandTest extends TestCase
{
public function testExample()
{
Artisan::call('your_command', [
'command_parameter_1' => 'value1',
'command_parameter_2' => 'value2',
]);
// If you need result of console output
$resultAsText = Artisan::output();
$this->assertTrue(true);
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)