提交 bb228ef5 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

update php scripts

上级 97d40d71
#!/usr/bin/env php
<?php
/**
[case]
title=check string matches pattern
cid=0
pid=0
[group]
1. exactly match >> hello
2. regular expression match >> `1\d{10}`
3. format string match >> `%s%d`
1. exactly match >> hello
2. regular expression match >> `1\d{10}`
3. format string match >> `%s%d`
[esac]
*/
print(">> hello\n");
print(">> 13905120512\n");
print(">> abc123\n");
print("hello\n");
print("13905120512\n");
print("abc123\n");
#!/usr/bin/env php
<?php
/**
[case]
title=extract content from webpage
cid=0
pid=0
[group]
1. Load web page from url http://xxx
2. Retrieve img element zt-logo.png in html
3. Check img exist >> `.*zt-logo.png`
1. Load web page from url http://xxx
2. Retrieve img element zt-logo.png in html
3. Check img exist >> `.*zt-logo.png`
[esac]
*/
$resp = file_get_contents('http://pms.zentao.net/user-login.html');
preg_match_all("/<img src='(.*)' .*>/U", $resp, $matches);
echo ">> " . $matches[1][0] . "\n";
\ No newline at end of file
$resp = file_get_contents('http://max.demo.zentao.net/user-login-Lw==.html');
preg_match_all("/<img src=\"(.*)\" .*>/U", $resp, $matches);
echo $matches[1][0] . "\n";
#!/usr/bin/env php
<?php
/**
[case]
title=check remote interface response
cid=0
pid=0
[group]
1. Send a request to interface http://xxx
2. Retrieve sessionID field from response json
3. Check its format >> `^[a-z0-9]{26}`
1. Send a request to interface http://xxx
2. Retrieve sessionID field from response json
3. Check its format >> `^[a-z0-9]{26}`
[esac]
*/
$resp = file_get_contents('http://zentaopms.ngtesting.com//?mode=getconfig');
$resp = file_get_contents('http://max.demo.zentao.net/pms/?mode=getconfig');
$json = json_decode($resp);
echo ">> " . $json->sessionID . "\n";
\ No newline at end of file
echo $json->sessionID . "\n";
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册