本文整理汇总了PHP中PHPUnit_Framework_Assert::assertNotRegExp方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Assert::assertNotRegExp方法的具体用法?PHP PHPUnit_Framework_Assert::assertNotRegExp怎么用?PHP PHPUnit_Framework_Assert::assertNotRegExp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_Assert
的用法示例。
在下文中一共展示了PHPUnit_Framework_Assert::assertNotRegExp方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: noEntryExists
/**
* @Given No entry was set
*/
public function noEntryExists()
{
$sitemap = $this->app['sitemap']->generate(false);
PHPUnit_Framework_Assert::assertNotRegExp('/\\<url\\>/', $sitemap);
}
示例2: assertNotRegExp
/**
* Checks that string not match with pattern
*
* @param string $pattern
* @param string $string
* @param string $message
*/
protected function assertNotRegExp($pattern, $string, $message = '')
{
\PHPUnit_Framework_Assert::assertNotRegExp($pattern, $string, $message);
}
示例3: assertNotRegExp
/**
* Asserts that a string does not match a given regular expression.
*
* @param string $pattern
* @param string $string
* @param string $message
* @since Method available since Release 2.1.0
*/
function assertNotRegExp($pattern, $string, $message = '')
{
return PHPUnit_Framework_Assert::assertNotRegExp($pattern, $string, $message);
}
示例4: dontSeeCurrentUrlMatches
public function dontSeeCurrentUrlMatches($uri)
{
\PHPUnit_Framework_Assert::assertNotRegExp($uri, $this->_getCurrentUri());
}
示例5: assertCommand
protected function assertCommand($command, $arguments, $info)
{
$method = $info['originalMethod'];
$result = $this->__call($method, $arguments);
if ($info['isBoolean']) {
if (!isset($info['negative']) || !$info['negative']) {
PHPUnit_Framework_Assert::assertTrue($result);
} else {
PHPUnit_Framework_Assert::assertFalse($result);
}
} else {
$expected = array_pop($arguments);
if (strpos($expected, 'exact:') === 0) {
$expected = substr($expected, strlen('exact:'));
if (!isset($info['negative']) || !$info['negative']) {
PHPUnit_Framework_Assert::assertEquals($expected, $result);
} else {
PHPUnit_Framework_Assert::assertNotEquals($expected, $result);
}
} else {
if (strpos($expected, 'regexp:') === 0) {
$expected = substr($expected, strlen('regexp:'));
} else {
if (strpos($expected, 'glob:') === 0) {
$expected = substr($expected, strlen('glob:'));
}
$expected = str_replace(array('*', '?'), array('.*', '.?'), $expected);
}
$expected = str_replace('/', '\\/', $expected);
if (!isset($info['negative']) || !$info['negative']) {
PHPUnit_Framework_Assert::assertRegExp('/' . $expected . '/', $result);
} else {
PHPUnit_Framework_Assert::assertNotRegExp('/' . $expected . '/', $result);
}
}
}
}
示例6: theResponseShouldNotContain
/**
* Checks that response body doesn't contains specific text.
*
* @param string $text
*
* @Then /^(?:the )?response should not contain "([^"]*)"$/
*/
public function theResponseShouldNotContain($text)
{
$expectedRegexp = '/' . preg_quote($text) . '/';
$actual = (string) $this->response->getBody();
Assertions::assertNotRegExp($expectedRegexp, $actual);
}
示例7: assertCommand
protected function assertCommand($command, $arguments, $info)
{
$method = $info['originalMethod'];
$requiresTarget = $info['requiresTarget'];
$result = $this->__call($method, $arguments);
if ($info['isBoolean']) {
if (!isset($info['negative']) || !$info['negative']) {
PHPUnit_Framework_Assert::assertTrue($result, $arguments[count($arguments) - 1]);
} else {
PHPUnit_Framework_Assert::assertFalse($result, $arguments[count($arguments) - 1]);
}
} else {
if ($requiresTarget === TRUE) {
$expected = $arguments[1];
} else {
$expected = $arguments[0];
}
if (strpos($expected, 'exact:') === 0) {
$expected = substr($expected, strlen('exact:'));
if (!isset($info['negative']) || !$info['negative']) {
PHPUnit_Framework_Assert::assertEquals($expected, $result);
} else {
PHPUnit_Framework_Assert::assertNotEquals($expected, $result);
}
} else {
$caseInsensitive = FALSE;
if (strpos($expected, 'regexp:') === 0) {
$expected = substr($expected, strlen('regexp:'));
} else {
if (strpos($expected, 'regexpi:') === 0) {
$expected = substr($expected, strlen('regexpi:'));
$caseInsensitive = TRUE;
} else {
if (strpos($expected, 'glob:') === 0) {
$expected = substr($expected, strlen('glob:'));
}
$expected = str_replace(array('*', '?'), array('.*', '.?'), $expected);
}
}
$expected = '/' . str_replace('/', '\\/', $expected) . '/';
if ($caseInsensitive) {
$expected .= 'i';
}
if (!isset($info['negative']) || !$info['negative']) {
PHPUnit_Framework_Assert::assertRegExp($expected, $result);
} else {
PHPUnit_Framework_Assert::assertNotRegExp($expected, $result);
}
}
}
}
示例8: toMatchPattern
public function toMatchPattern($pattern)
{
if ($this->negate) {
a::assertNotRegExp($pattern, $this->actual);
} else {
a::assertRegExp($pattern, $this->actual);
}
}
示例9: notToMatchRegExp
/**
* Expect that a string does not match a given regular expression.
*
* @param string $pattern
* @param string $message
*
* @return Expect
*/
public function notToMatchRegExp($pattern, $message = '')
{
Assert::assertNotRegExp($pattern, $this->value, $message);
return $this;
}
示例10: theResponseShouldNotContain
/**
* Checks that response body doesn't contains specific text.
*
* @param string $text
*
* @Then /^(?:the )?response should not contain "([^"]*)"$/
*/
public function theResponseShouldNotContain($text)
{
\PHPUnit_Framework_Assert::assertNotRegExp('/' . preg_quote($text) . '/', $this->browser->getLastResponse()->getContent());
}