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 () { $th..

Decoded Output download

<?php

use PHPUnit\Framework\ExpectationFailedException;

beforeEach(function () {
    $this->user = [
        'id' => 1,
        'name' => 'Nuno',
        'email' => '[email protected]',
    ];
});

test('pass', function () {
    expect($this->user)->toMatchArray([
        'name' => 'Nuno',
        'email' => '[email protected]',
    ]);
});

test('failures', function () {
    expect($this->user)->toMatchArray([
        'name' => 'Not the same name',
        'email' => '[email protected]',
    ]);
})->throws(ExpectationFailedException::class);

test('failures with custom message', function () {
    expect($this->user)->toMatchArray([
        'name' => 'Not the same name',
        'email' => '[email protected]',
    ], 'oh no!');
})->throws(ExpectationFailedException::class, 'oh no!');

test('not failures', function () {
    expect($this->user)->not->toMatchArray([
        'id' => 1,
    ]);
})->throws(ExpectationFailedException::class);
 ?>

Did this file decode correctly?

Original Code

<?php

use PHPUnit\Framework\ExpectationFailedException;

beforeEach(function () {
    $this->user = [
        'id' => 1,
        'name' => 'Nuno',
        'email' => '[email protected]',
    ];
});

test('pass', function () {
    expect($this->user)->toMatchArray([
        'name' => 'Nuno',
        'email' => '[email protected]',
    ]);
});

test('failures', function () {
    expect($this->user)->toMatchArray([
        'name' => 'Not the same name',
        'email' => '[email protected]',
    ]);
})->throws(ExpectationFailedException::class);

test('failures with custom message', function () {
    expect($this->user)->toMatchArray([
        'name' => 'Not the same name',
        'email' => '[email protected]',
    ], 'oh no!');
})->throws(ExpectationFailedException::class, 'oh no!');

test('not failures', function () {
    expect($this->user)->not->toMatchArray([
        'id' => 1,
    ]);
})->throws(ExpectationFailedException::class);

Function Calls

None

Variables

None

Stats

MD5 c28fcd96eccaad74f82cd8bf9af65971
Eval Count 0
Decode Time 82 ms