expect / expect-filesystem
expect 的文件系统匹配器
2.0.0
2016-08-10 03:25 UTC
Requires
- php: >=5.6.0
- expect/expect: ~2.0
Requires (Dev)
- beberlei/assert: ~2.3
- cloak/peridot-cloak-plugin: ~2.0
- cloak/robo-coveralls-kit: ~2.1
- codegyre/robo: ~0.6
- holyshared/peridot-temporary-plugin: ~1.0
- holyshared/robo-peridot: ~2.0
- peridot-php/peridot: ~1.16
- peridot-php/peridot-dot-reporter: ~1.0
- phpspec/prophecy: ~1.5
This package is auto-updated.
Last update: 2024-09-15 15:18:06 UTC
README
基本用法
创建 expect 的配置文件。
文件的格式是 toml。
packages = [ "expect\\filesystem\\FileSystem" ]
加载您创建的配置文件。
use expect\Expect; use expect\configurator\FileConfigurator; $configurator = new FileConfigurator(__DIR__ . '/.expect.toml'); Expect::configure($configurator); Expect::that('log.txt')->toBeExists(); //pass Expect::that('not_found_log.txt')->toBeExists(); //failed
所有匹配器
toBeExists
Expect::that($file)->toBeExists();
toBeReadable
Expect::that($file)->toBeReadable();
toBeWritable
Expect::that($file)->toBeWritable();
toBeExecutable
Expect::that($file)->toBeExecutable();
toBeDirectory
Expect::that($file)->toBeDirectory();
toBeFile
Expect::that($file)->toBeFile();
toBeMode
Expect::that($file)->toBeMode(644);