expect / expect-filesystem
File system matcher for 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-12-15 15:50:29 UTC
README
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);