Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php use PHPUnit\Framework\ExpectationFailedException; beforeEach(function () { tou..
Decoded Output download
<?php
use PHPUnit\Framework\ExpectationFailedException;
beforeEach(function () {
touch($this->tempFile = sys_get_temp_dir().'/fake.file');
});
afterEach(function () {
unlink($this->tempFile);
});
test('pass', function () {
expect($this->tempFile)->toBeFile();
});
test('failures', function () {
expect('/random/path/whatever.file')->toBeFile();
})->throws(ExpectationFailedException::class);
test('failures with custom message', function () {
expect('/random/path/whatever.file')->toBeFile('oh no!');
})->throws(ExpectationFailedException::class, 'oh no!');
test('not failures', function () {
expect($this->tempFile)->not->toBeFile();
})->throws(ExpectationFailedException::class);
?>
Did this file decode correctly?
Original Code
<?php
use PHPUnit\Framework\ExpectationFailedException;
beforeEach(function () {
touch($this->tempFile = sys_get_temp_dir().'/fake.file');
});
afterEach(function () {
unlink($this->tempFile);
});
test('pass', function () {
expect($this->tempFile)->toBeFile();
});
test('failures', function () {
expect('/random/path/whatever.file')->toBeFile();
})->throws(ExpectationFailedException::class);
test('failures with custom message', function () {
expect('/random/path/whatever.file')->toBeFile('oh no!');
})->throws(ExpectationFailedException::class, 'oh no!');
test('not failures', function () {
expect($this->tempFile)->not->toBeFile();
})->throws(ExpectationFailedException::class);
Function Calls
None |
Stats
MD5 | 8ba6573190b2db2b0876213eb18d590f |
Eval Count | 0 |
Decode Time | 80 ms |