test_file_regexp.phpt

来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· PHPT 代码 · 共 16 行

PHPT
16
字号
--TEST--
PEAR_PackageFileManager_File->getRegExpableSearchString, file pattern
--SKIPIF--
--FILE--
<?php
require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'setup.php.inc';
$res = $packagexml->_getRegExpableSearchString('frog?-*.php');
$phpunit->assertEquals('frog.\-.*\.php', $res, 'wrong regexp');
$phpunit->assertNotFalse(preg_match("/^$res$/", 'frog1-hairy.php'), 'did not match frog1-hairy.php');
$phpunit->assertNotFalse(preg_match("/^$res$/", 'frog1-hairy/thingo.php'), 'did not match frog1-hairy/thingo.php');
$phpunit->assertNotFalse(preg_match("/^$res$/", 'frog1-hairy\\thingo.php'), 'did not match frog1-hairy\\thingo.php');
$phpunit->assertNotTrue(preg_match("/^$res$/", 'frog11-hairy.php'), 'matched frog11-hairy.php');
echo 'tests done';
?>
--EXPECT--
tests done

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?