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)->toBeWritableFile();
});

test('failures', function () {
    expect('/random/path/whatever.file')->toBeWritableFile();
})->throws(ExpectationFailedException::class);

test('failures with custom message', function () {
    expect('/random/path/whatever.file')->toBeWritableFile('oh no!');
})->throws(ExpectationFailedException::class, 'oh no!');

test('not failures', function () {
    expect($this->tempFile)->not->toBeWritableFile();
})->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)->toBeWritableFile();
});

test('failures', function () {
    expect('/random/path/whatever.file')->toBeWritableFile();
})->throws(ExpectationFailedException::class);

test('failures with custom message', function () {
    expect('/random/path/whatever.file')->toBeWritableFile('oh no!');
})->throws(ExpectationFailedException::class, 'oh no!');

test('not failures', function () {
    expect($this->tempFile)->not->toBeWritableFile();
})->throws(ExpectationFailedException::class);

Function Calls

None

Variables

None

Stats

MD5 c334e2e9561665f10823f3d94adf2460
Eval Count 0
Decode Time 86 ms