当前位置: 首页>>代码示例>>PHP>>正文


PHP meq函数代码示例

本文整理汇总了PHP中meq函数的典型用法代码示例。如果您正苦于以下问题:PHP meq函数的具体用法?PHP meq怎么用?PHP meq使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了meq函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: eq

<?php

$b = new \testman\Browser();
$b->do_get(url('test_index::csrf'));
eq(200, $b->status());
meq('<result>', $b->body());
$b->do_post(url('test_index::csrf'));
eq(403, $b->status());
meq('<error>', $b->body());
$b->do_get(url('test_index::csrf'));
eq(200, $b->status());
meq('<result>', $b->body());
$no = null;
if (\org\rhaco\Xml::set($xml, $b->body(), 'csrftoken')) {
    $no = $xml->value();
}
neq(null, $no);
$b->vars('csrftoken', $no);
$b->do_post(url('test_index::csrf'));
eq(200, $b->status());
meq('<result>', $b->body());
$b->do_get(url('test_index::csrf_template'));
eq(200, $b->status());
meq('<form><input type="hidden" name="csrftoken"', $b->body());
meq('<form method="post"><input type="hidden" name="csrftoken"', $b->body());
meq('<form method="get"><input type="hidden" name="csrftoken"', $b->body());
meq(sprintf('<form action="%s"><input type="hidden" name="csrftoken"', url('test_index::csrf')), $b->body());
meq('<form action="http://localhost"><input type="text" name="aaa" /></form>', $b->body());
开发者ID:tokushima,项目名称:rhaco3,代码行数:28,代码来源:csrf.php

示例2: b

<?php

$b = b();
$b->vars('abc', 'aaa');
$b->do_get(url('index::group_aaa'));
meq('{"result":{"abc":"aaa"}}', $b->body());
$b->vars('abc', 'bbb');
$b->do_get(url('index::group_bbb'));
meq('{"result":{"abc":"bbb"}}', $b->body());
开发者ID:tokushima,项目名称:ebi,代码行数:9,代码来源:index.php

示例3: meq

<body>
\t<a href="http://rhaco.org"></a>
\t<a href="http://localhost/rhaco3/test_index/"></a>
\t<a href="https://localhost/rhaco3/test_index/secure"></a>
\t<a href="https://localhost/rhaco3/test_login/secure"></a>
\t<img src="http://localhost/images/abc.jpg" />
\t<img src="http://localhost/rhaco3/resources/media/images/def.jpg" />
\t<img src="http://localhost/rhaco3/resources/media/images/def.jpg" />
</body>
</html>
PRE;
} else {
    $pre = <<<PRE
<html>
<body>
\t<a href="http://rhaco.org"></a>
\t<a href="http://localhost:8000/test_index.php/"></a>
\t<a href="https://localhost:8000/test_index.php/secure"></a>
\t<a href="https://localhost:8000/test_login.php/secure"></a>
\t<img src="http://localhost/images/abc.jpg" />
\t<img src="http://localhost:8000/resources/media/images/def.jpg" />
\t<img src="http://localhost:8000/resources/media/images/def.jpg" />
</body>
</html>
PRE;
}
meq('https://', url('test_login::secure'));
$b = new \testman\Browser();
$b->do_get(url('test_index::to_secure'));
eq(200, $b->status());
eq($pre, $b->body());
开发者ID:tokushima,项目名称:rhaco3,代码行数:31,代码来源:secure.php

示例4: eq

<?php

$b = new \testman\Browser();
$b->vars('user_name', 'hogeuser');
$b->vars('password', 'hogehoge');
$b->do_post(url('test_login::login'));
eq(200, $b->status());
meq('<user_name>hogeuser</user_name>', $b->body());
$b->do_post(url('test_login::aaa'));
eq(200, $b->status());
meq('<user><nickname>hogeuser</nickname><code>1234</code></user>', $b->body());
$b->do_post(url('test_login::logout'));
eq(200, $b->status());
meq('<login>false</login>', $b->body());
$b->do_post(url('test_login::aaa'));
eq(401, $b->status());
meq('<message group="do_login" type="LogicException">Unauthorized</message>', $b->body());
开发者ID:tokushima,项目名称:rhaco3,代码行数:17,代码来源:logout.php

示例5: b

<?php

$b = b();
$b->do_get(url('index::form_obj'));
meq('ABC', $b->body());
meq(10, $b->body());
meq(999, $b->body());
$b->do_get(url('index::form_obj') . '?value=XYZ');
mneq('ABC', $b->body());
meq('XYZ', $b->body());
meq(10, $b->body());
meq(999, $b->body());
开发者ID:tokushima,项目名称:ebi,代码行数:12,代码来源:form_object.php

示例6: eq

<?php

$b = new \testman\Browser();
$b->do_get(url('test_index::index'));
eq(200, $b->status());
meq('INDEX', $b->body());
meq('hogehoge_xml_var', $b->body());
meq('A1A2A3', $b->body());
meq('	hogehoge_xml_var_value', $b->body());
meq('[AAA]', $b->body());
meq('[BBB]', $b->body());
meq('AAA', $b->body());
meq('BBB', $b->body());
meq('CCC', $b->body());
meq('resources/media', $b->body());
开发者ID:tokushima,项目名称:rhaco3,代码行数:15,代码来源:index.php

示例7: b

<?php

/**
 * login要求のaction
 */
$b = b();
// loginにリダイレクトされる
$b->do_get(url('login3::aaa'));
eq(401, $b->status());
eq(url('login3::login'), $b->url());
eq('{"error":[{"message":"Unauthorized","type":"UnauthorizedException"}]}', $b->body());
// ログインしたらaaaに戻る
$b->vars('user', 'tokushima');
$b->vars('password', 'hogehoge');
$b->do_post(url('login3::login'));
eq(url('login3::aaa'), $b->url());
eq(200, $b->status());
// ログイン済みならリダイレクトされない
$b->do_get(url('login3::aaa'));
eq(url('login3::aaa'), $b->url());
eq(200, $b->status());
meq('{"result":{"abc":123}}', $b->body());
开发者ID:tokushima,项目名称:ebi,代码行数:22,代码来源:login_required.php

示例8: eq

<?php

$b = new \testman\Browser();
$b->do_get(url('test_index::sample_flow_exception_package_throw_xml'));
eq(403, $b->status());
meq('<message group="" type="SampleException">sample error</message>', $b->body());
开发者ID:tokushima,项目名称:rhaco3,代码行数:6,代码来源:sample_flow_exception_package_throw_xml.php

示例9: b

<?php

$b = b();
$b->vars('abc', 'aaa');
$b->do_get(url('index::group_aaa_xml'));
eq(200, $b->status());
meq('<result><abc>aaa</abc></result>', $b->body());
$b->vars('abc', 'bbb');
$b->do_get(url('index::group_bbb_xml'));
eq(200, $b->status());
meq('<result><abc>bbb</abc></result>', $b->body());
$b->vars('abc', 'bbb');
$b->do_get(url('index::group_eee_xml'));
eq(200, $b->status());
eq('<error><message type="LogicException">raise test</message></error>', $b->body());
// json output
$b = b();
$b->header('Accept', 'application/json');
$b->vars('abc', 'aaa');
$b->do_get(url('index::group_aaa_xml'));
eq(200, $b->status());
meq('{"result":{"abc":"aaa"}}', $b->body());
$b->header('Accept', 'application/json');
$b->vars('abc', 'bbb');
$b->do_get(url('index::group_eee_xml'));
eq(200, $b->status());
eq('{"error":[{"message":"raise test","type":"LogicException"}]}', $b->body());
开发者ID:tokushima,项目名称:ebi,代码行数:27,代码来源:group_xml.php

示例10: b

<?php

$b = b();
$b->do_get(url('index::requestflow_vars_template'));
eq(200, $b->status());
meq('<html>', $b->body());
meq('AAA123456BBB', $b->body());
$b->header('accept', 'application/debug');
$b->do_get(url('index::requestflow_vars_template'));
eq(200, $b->status());
eq('{"result":{"abc":123,"def":456}}', $b->body());
开发者ID:tokushima,项目名称:ebi,代码行数:11,代码来源:accept_debug.php

示例11: meq

<?php

$b = new \testman\Browser();
$b->do_post(url('test_index::dao/insert'));
$b->do_post(url('test_index::dao/get'));
meq('<string>abcdefg</string><text />', $b->body());
eq(200, $b->status());
meq('<string>abcdefg</string><text />', $b->body());
$b = new \testman\Browser();
$b->do_post(url('test_index::dao/update'));
$b->do_post(url('test_index::dao/get'));
meq('<string>abcdefg</string><text>xyz</text>', $b->body());
$b = new \testman\Browser();
$b->do_post(url('test_index::dao/delete'));
$b = new \testman\Browser();
$b->do_post(url('test_index::dao/insert'));
$b->do_post(url('test_index::dao/get'));
meq('<string>abcdefg</string><text />', $b->body());
$b = new \testman\Browser();
$b->do_post(url('test_index::dao/update'));
$b->do_post(url('test_index::dao/get'));
meq('<string>abcdefg</string><text>xyz</text>', $b->body());
$b = new \testman\Browser();
$b->do_post(url('test_index::dao/delete'));
eq('<result />', $b->body());
开发者ID:tokushima,项目名称:rhaco3,代码行数:25,代码来源:dao.php

示例12: meq

<?php

$b = new \ebi\Browser();
$b->do_get(url('index::form1'));
$b->vars('id1', 'abc');
\ebi\HtmlForm::submit($b);
meq('ID1=abc', $b->body());
$b->vars('id2', 'def');
\ebi\HtmlForm::submit($b, 'next_form');
meq('ID2=def', $b->body());
$b->vars('id3', 'ghi');
\ebi\HtmlForm::submit($b);
meq('ID3=ghi', $b->body());
$b->do_get(url('index::form_select'));
meq('<select name="data_id"><option value="10">AAA</option><option value="20" selected="selected">BBB</option><option value="30">CCC</option></select>', $b->body());
$b->do_get(url('index::form_select_obj'));
meq('<select name="data_id"><option value="10">AAA</option>
<option value="20" selected="selected">BBB</option>
<option value="30">CCC</option>
</select>', $b->body());
开发者ID:tokushima,项目名称:ebi,代码行数:20,代码来源:HtmlForm.php

示例13: eq

<?php

$b = new \testman\Browser();
$b->do_get(url('test_index::under_var'));
eq(200, $b->status());
meq('hogehoge', $b->body());
meq('ABC', $b->body());
meq('INIT', $b->body());
开发者ID:tokushima,项目名称:rhaco3,代码行数:8,代码来源:under_var.php

示例14: b

<?php

$b = b();
$b->do_get(url('index::template_parent'));
eq(200, $b->status());
meq('Parent', $b->body());
meq('default_child', $b->body());
$b->do_get(url('index::template_child'));
eq(200, $b->status());
meq('Parent', $b->body());
mneq('default_child', $b->body());
meq('new_child', $b->body());
meq('default_grandchild', $b->body());
$b->do_get(url('index::template_grandchild'));
eq(200, $b->status());
meq('Parent', $b->body());
mneq('default_child', $b->body());
meq('new_child', $b->body());
mneq('default_grandchild', $b->body());
meq('new_grandchild', $b->body());
$b->do_get(url('index::template_grandchild_super'));
eq(200, $b->status());
mneq('Parent', $b->body());
meq('Super', $b->body());
mneq('default_super_child', $b->body());
meq('new_child', $b->body());
mneq('default_grandchild', $b->body());
meq('new_grandchild', $b->body());
开发者ID:tokushima,项目名称:ebi,代码行数:28,代码来源:template.php

示例15: eq

<?php

$b = new \testman\Browser();
$b->do_get(url('test_index::module_add_exceptions'));
eq(200, $b->status());
meq('INDEX', $b->body());
meq('BEFORE_FLOW', $b->body());
meq('AFTER_FLOW', $b->body());
meq('INIT_TEMPLATE', $b->body());
meq('BEFORE_TEMPLATE', $b->body());
meq('AFTER_TEMPLATE', $b->body());
meq('BEFORE_FLOW_PRINT_TEMPLATE', $b->body());
开发者ID:tokushima,项目名称:rhaco3,代码行数:12,代码来源:module_add_exceptions.php


注:本文中的meq函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。