expect/expect-filesystem

File system matcher for expect

2.0.0 2016-08-10 03:25 UTC

This package is auto-updated.

Last update: 2024-11-15 15:37:08 UTC


README

Build Status HHVM Status Coverage Status Scrutinizer Code Quality Dependency Status

Basic usage

Create a configuration file of expect.
The format of the file is toml.

packages = [
  "expect\\filesystem\\FileSystem"
]

Load the configuration file that you created.

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

All of matcher

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