本文整理汇总了PHP中Symfony\Bundle\FrameworkBundle\Test\WebTestCase::assertSame方法的典型用法代码示例。如果您正苦于以下问题:PHP WebTestCase::assertSame方法的具体用法?PHP WebTestCase::assertSame怎么用?PHP WebTestCase::assertSame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Bundle\FrameworkBundle\Test\WebTestCase
的用法示例。
在下文中一共展示了WebTestCase::assertSame方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assertSame
public static function assertSame($var1, $var2, $message = '')
{
parent::assertSame($var1, $var2, $message);
// assertEquals() throws an exception if not true, so the following
// won't occur unless the messages actually are the same
$success = print_r($var1, true) . ' is the same as ' . print_r($var2, true);
self::$messages = array_merge(self::$messages, array($success));
}
示例2: iShouldBeBlocked
/**
* @Given /^I should be blocked$/
*/
public function iShouldBeBlocked()
{
WebTestCase::assertSame(500, $this->getMainContext()->getSession()->getStatusCode());
}
示例3: shouldBeBanned
/**
* @Given /^the user should be banned$/
*/
public function shouldBeBanned()
{
$elements = $this->getPage()->findAll('css', 'table > tbody > tr');
$didFindBanStatus = false;
$result = 0;
foreach ($elements as $element) {
$cells = $element->findAll('css', 'td');
if (strpos(strtolower($cells[0]->getText()), 'ban status') !== false) {
$didFindBanStatus = true;
$banStatus = strtolower($cells[1]->getText());
if (strpos($banStatus, 'banned') !== false) {
$result = self::RESULT_BANNED;
}
if (strpos($banStatus, 'active') !== false) {
$result = self::RESULT_ACTIVE;
}
break;
}
}
WebTestCase::assertTrue($didFindBanStatus, "ban status was not found.");
WebTestCase::assertSame(self::RESULT_BANNED, $result, "user should is active but should be banned.");
}