本文整理汇总了PHP中LimeTest::todo方法的典型用法代码示例。如果您正苦于以下问题:PHP LimeTest::todo方法的具体用法?PHP LimeTest::todo怎么用?PHP LimeTest::todo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LimeTest
的用法示例。
在下文中一共展示了LimeTest::todo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: LimeTest
Yaml::setSpecVersion('1.1');
$t = new LimeTest(148);
$parser = new Parser();
$path = __DIR__ . '/../../../../fixtures/Symfony/Components/Yaml';
$files = $parser->parse(file_get_contents($path . '/index.yml'));
foreach ($files as $file) {
$t->diag($file);
$yamls = file_get_contents($path . '/' . $file . '.yml');
// split YAMLs documents
foreach (preg_split('/^---( %YAML\\:1\\.0)?/m', $yamls) as $yaml) {
if (!$yaml) {
continue;
}
$test = $parser->parse($yaml);
if (isset($test['todo']) && $test['todo']) {
$t->todo($test['test']);
} else {
$expected = var_export(eval('return ' . trim($test['php']) . ';'), true);
$t->is(var_export($parser->parse($test['yaml']), true), $expected, $test['test']);
}
}
}
// test tabs in YAML
$yamls = array("foo:\n\tbar", "foo:\n \tbar", "foo:\n\t bar", "foo:\n \t bar");
foreach ($yamls as $yaml) {
try {
$content = $parser->parse($yaml);
$t->fail('YAML files must not contain tabs');
} catch (ParserException $e) {
$t->pass('YAML files must not contain tabs');
}