expect/expect-filesystem

expect 的文件系统匹配器

2.0.0 2016-08-10 03:25 UTC

This package is auto-updated.

Last update: 2024-09-15 15:18:06 UTC


README

Build Status HHVM Status Coverage Status Scrutinizer Code Quality Dependency Status

基本用法

创建 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);