本文整理汇总了PHP中sfTestFunctional::getResponseDom方法的典型用法代码示例。如果您正苦于以下问题:PHP sfTestFunctional::getResponseDom方法的具体用法?PHP sfTestFunctional::getResponseDom怎么用?PHP sfTestFunctional::getResponseDom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfTestFunctional
的用法示例。
在下文中一共展示了sfTestFunctional::getResponseDom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
<?php
include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new sfTestFunctional(new sfBrowser(), new lime_test(null, new lime_output_color()));
$browser->info('0. Login')->get('/member/login')->click('ログイン', array('authMailAddress' => array('mail_address' => 'sns@example.com', 'password' => 'password')))->isStatusCode(302)->info('1. Create a community.')->get('community/edit')->click('送信', array('community' => array('name' => 'test', 'config' => array('public_flag' => 'public', 'topic_authority' => 'public', 'description' => 'test'))))->isStatusCode(302)->info('2. Community list is shown on the member\'s home.')->get('member/home');
$selector = new sfDomCssSelector($browser->getResponseDom());
$list = $selector->getElements('#Left h3:contains("コミュニティリスト")');
$browser->test()->ok($list, 'a community list gadget exists');
$photoLink = '';
$textLink = '';
$xpath = new DOMXPath($browser->getResponseDom());
foreach ($xpath->query('../../table/tr', $list[0]) as $item) {
if ($item->getAttribute('class') === 'photo') {
$photoLink = $item->firstChild->getElementsByTagName('a')->item(0)->getAttribute('href');
} elseif ($item->getAttribute('class') === 'text') {
$textLink = $item->firstChild->getElementsByTagName('a')->item(0)->getAttribute('href');
}
}
$browser->test()->ok($photoLink, 'photo link exists');
$browser->test()->ok($textLink, 'text link exists');
$browser->info('links in a community list is a valid (ref. #3546)')->info('photo link is a valid')->get($photoLink)->isStatusCode(200)->with('request')->begin()->isParameter('module', 'community')->isParameter('action', 'home')->end()->info('text link is a valid')->get($textLink)->isStatusCode(200)->with('request')->begin()->isParameter('module', 'community')->isParameter('action', 'home')->end();