本文整理汇总了PHP中PHPUnit_Framework_Assert::assertStringMatchesFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Assert::assertStringMatchesFormat方法的具体用法?PHP PHPUnit_Framework_Assert::assertStringMatchesFormat怎么用?PHP PHPUnit_Framework_Assert::assertStringMatchesFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_Assert
的用法示例。
在下文中一共展示了PHPUnit_Framework_Assert::assertStringMatchesFormat方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
function run()
{
$raw = is_readable($this->file) ? file_get_contents($this->file) : '';
$sections = array_values(array_filter(array_map('trim', preg_split('/^--(TEST|FILE|EXPECTF)--$/m', $raw))));
if (3 === count($sections)) {
list($this->name, $this->source, $this->expected) = $sections;
try {
$this->out = yay_parse($this->source);
if (false !== strpos($this->name, '--pretty-print')) {
$this->out = yay_pretty($this->out) . PHP_EOL . PHP_EOL . '?>';
}
} catch (YayParseError $e) {
$this->out = $e->getMessage();
// $this->out = (string) $e;
} catch (\PhpParser\Error $e) {
$this->out = 'PHP ' . $e->getMessage();
// $this->out = (string) $e;
} catch (Exception $e) {
$this->out = (string) $e;
}
try {
Assert::assertStringMatchesFormat($this->expected, $this->out);
$this->status = self::PASSED;
} catch (Exception $e) {
$this->status = self::FAILED;
throw $e;
}
} else {
$this->status = self::BORKED;
}
}
示例2: assertStringMatchesFormat
/**
* Asserts that a string matches a given format string.
*
* @param string $format
* @param string $string
* @param string $message
* @since Method available since Release 3.5.0
*/
function assertStringMatchesFormat($format, $string, $message = '')
{
return PHPUnit_Framework_Assert::assertStringMatchesFormat($format, $string, $message);
}
示例3: assertCollectedData
/**
* Assert that collected data matches expected format
*
* @param string $expectedData
*/
public static function assertCollectedData($expectedData)
{
PHPUnit_Framework_Assert::assertStringMatchesFormat($expectedData, self::$_collectedData, 'Expected data went through the stream.');
}
示例4: toMatchFormat
public function toMatchFormat($format)
{
if ($this->negate) {
a::assertStringNotMatchesFormat($format, $this->actual);
} else {
a::assertStringMatchesFormat($format, $this->actual);
}
}
示例5: matchesFormat
public function matchesFormat($format)
{
Assert::assertStringMatchesFormat($format, $this->actual, $this->description);
return $this;
}
示例6: matchesFormat
public function matchesFormat($format)
{
a::assertStringMatchesFormat($format, $this->actual, $this->description);
}
示例7: toMatchFormat
/**
* Expect that a string matches a given format string.
*
* @param string $format
* @param string $message
*
* @return Expect
*/
public function toMatchFormat($format, $message = '')
{
Assert::assertStringMatchesFormat($format, $this->value, $message);
return $this;
}