#!/usr/bin/env php
Test log line 1
Test log line 2
- 执行testtaskTest模块的formatZtfLogTest方法,参数是'{"log": "Test case: 失败\nTest case: pass"}', array @Test case: 失败Test case: 通过
- 执行testtaskTest模块的formatZtfLogTest方法,参数是'{"log": "Test log"}', array @Test log共有3个步骤,2个通过,1个失败。
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
su('admin');
$testtaskTest = new testtaskModelTest();
r($testtaskTest->formatZtfLogTest('', array())) && p() && e('0');
r($testtaskTest->formatZtfLogTest('{"test": "value"}', array())) && p() && e('0');
r($testtaskTest->formatZtfLogTest('{"log": "Test log line 1\nTest log line 2"}', array())) && p() && e('Test log line 1Test log line 2');
r($testtaskTest->formatZtfLogTest('{"log": "Test case: 失败\nTest case: pass"}', array())) && p() && e("Test case: 失败Test case: 通过");
r($testtaskTest->formatZtfLogTest('{"log": "Test log"}', array(array('result' => 'pass'), array('result' => 'fail'), array('result' => 'pass')))) && p() && e("Test log共有3个步骤,2个通过,1个失败。");