我经常使用echo来调试功能代码:
public function MyFunc() {
// some code...
echo "OK";
// some code...
}
Run Code Online (Sandbox Code Playgroud)
如何检查我的函数print/echo是什么?
(伪代码):
MyFunc();
if (<when something was printed>){
echo "You forgot to delete echo calls in this function";
}
Run Code Online (Sandbox Code Playgroud) 我正在使用PayPal-PHP-SDK访问 PayPal API。
我需要一个“数量(用户或席位)定价计划”,我正在遵循本指南:https : //developer.paypal.com/docs/subscriptions/integrate/。指南中的步骤包括这些 API 端点:
/v1/catalogs/products
/v1/billing/plans
/v1/billing/subscriptions
Run Code Online (Sandbox Code Playgroud)
我只找到了如何/v1/billing/plans
使用 SDK创建计划(),但我不知道如何添加参数:"quantity_supported": true
我没有找到任何示例/样本/v1/catalogs/products
, /v1/billing/subscriptions
可以用当前的 PayPal-PHP-SDK 完成吗?
这是一个PHPUnit测试:
class EqualsTest extends PHPUnit_Framework_TestCase
{
public function testSuccess()
{
$this->assertEquals(array('01', 'a', 'b'), array(1, 'a', 'b'));
}
}
Run Code Online (Sandbox Code Playgroud)
'01'
是一个字符串,1
是一个整数,但是测试没有失败! assertEquals
不比较类型...如何克服这个问题?