====
github.com/progorker =_============
_ __ _ _ ___ __ _ ___ _ _| |_____ _ _
| '_ \ '_/ _ \/ _` / _ \ '_| / / -_) '_|
| .__/_| \___/\__, \___/_| |_\_\___|_|
=|_|===========|___/======================
API References of phpTestor
----- oOo -----
[procedure] api_testor_result
==========================================
-------|__/-------------------------
SYNTAX
------------------------------------
function \phptestor\api_testor_result( $p_token, $p_id, &$p_results, $p_beauty = false ) {
}
-------|__/-------------------------
USAGE
------------------------------------
$) $token = '_'; $username = 'mytestor'; $password = 'rzutomqahegpnyx'; \phptestor\api_testor_login( $token, $username, $password ); echo "\n", "Token: ", $token, "\n";
----------------------------
Token: 7e84ee58798b4a6c10367e72e59f3ed0
----------------------------
$) $suite_id = -1; $suite_code = 'phpTestorTrial'; \phptestor\api_testor_suite( $token, $suite_id, $suite_code ); echo "\n", "Suite ID: ", $suite_id, "\n";
----------------------------
Suite ID: 1
----------------------------
$) \phptestor\api_testor_clean( $token, $suite_id );
$) $case_id = -1; $case_code = 'test_numbers'; \phptestor\api_testor_case( $token, $case_id, $suite_id, $case_code ); echo "\n", "Case ID: ", $case_id, "\n";
----------------------------
Case ID: 3
----------------------------
$) $test_id = -1; $test_code = 'greater.1'; $condition = 2 > 1; $message = '[greater.1] test is success!'; \phptestor\api_testor_test( $token, $test_id, $suite_id, $case_id, $test_code, $condition, $message ); echo "\n", "Test ID: ", $test_id, "\n";
----------------------------
Test ID: 3
----------------------------
$) $results = ''; $beauty = false; \phptestor\api_testor_finish( $token, $suite_id, $results, $beauty ); echo "\n", "===== Results: Finished =====", "\n", $results, "\n";
----------------------------
===== Results: Finished =====
+---------+--------+----------------+----+---------------+--------------+------------+------------+
| version | status | code | id | success_count | failed_count | test_count | case_count |
+---------+--------+----------------+----+---------------+--------------+------------+------------+
| 2 | GREEN | phpTestorTrial | 1 | 1 | 0 | 1 | 1 |
+---------+--------+----------------+----+---------------+--------------+------------+------------+
+------------------------------------------+-----------------------------------------------+
| To re-print: | To get source file of [a] test case: |
+------------------------------------------+-----------------------------------------------+
| $) call api_testor_result('_token_', 1); | $) call api_testor_source('_token_', 1, 'a'); |
+------------------------------------------+-----------------------------------------------+
----------------------------
$) $results = ''; $beauty = false; \phptestor\api_testor_result( $token, $suite_id, $results, $beauty ); echo "\n", "===== Results: Result =====", "\n", $results, "\n";
----------------------------
===== Results: Result =====
+---------+--------+----------------+----+---------------+--------------+------------+------------+
| version | status | code | id | success_count | failed_count | test_count | case_count |
+---------+--------+----------------+----+---------------+--------------+------------+------------+
| 2 | GREEN | phpTestorTrial | 1 | 1 | 0 | 1 | 1 |
+---------+--------+----------------+----+---------------+--------------+------------+------------+
+------------------------------------------+-----------------------------------------------+
| To re-print: | To get source file of [a] test case: |
+------------------------------------------+-----------------------------------------------+
| $) call api_testor_result('_token_', 1); | $) call api_testor_source('_token_', 1, 'a'); |
+------------------------------------------+-----------------------------------------------+
----------------------------