This plugin checks what's inside the files.
| pest | php | pest-plugin-inside |
|---|---|---|
| ^2.14 | ^8.1 | ^1.0.0 |
| ^3.0 | ^8.2 | ^1.2.0 |
| ^4.0 | ^8.3 | ^1.7.0 |
- php
- txt
- stub
Make sure a file or directory files returns an array with all lowercase values.
expect('file.php')->toReturnLowercase();Make sure a file or directory files returns an array with all uppercase values.
expect('file.php')->toReturnUppercase();Make sure a file or directory files returns an array with unique values.
expect('file.php')->toReturnUnique();Make sure a file or directory files returns an array with single words.
expect('file.php')->toReturnSingleWords();Make sure a file or directory files returns an array with words that are ordered.
expect('file.php')->toBeOrdered();Make sure a file or directory files returns only string values.
expect('file.php')->toReturnStrings();Make sure a file or directory files does not return any empty value.
expect('file.php')->forbidEmpty();<?php
// lowercase.php
return [
'lower',
'case',
'lowercase',
'array' => [
'lower',
'case',
],
];expect('lowercase.php')->toReturnLowercase();<?php
// notlowercase.php
return [
'lower',
'caSe',
'lowercase',
];expect('notlowercase.php')->toReturnLowercase();directory
├── file.js
├── file.php
├── subdirectory
├── file.json
├── file1.php
├── file2.php- To scan all the php files in
directoryand all its subdirectories (file.php,file1.phpandfile2.php), we can use:
expect('directory')->toReturnLowercase();- We can also specify the scan depth using
depth.
expect('directory')->toReturnLowercase(depth:0);In this case it will only scan direct php file which is file.php.