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 namespace WireUi\Components\DatetimePicker\tests\Unit; use Illuminate\Support\Carb..

Decoded Output download

<?php

namespace WireUi\Components\DatetimePicker\tests\Unit;

use Illuminate\Support\Carbon;
use WireUi\Components\DatetimePicker\Picker as DatetimePicker;
use WireUi\Components\Wrapper\WireUi\Color;
use WireUi\Components\Wrapper\WireUi\Rounded;
use WireUi\WireUi\Shadow;

beforeEach(function () {
    $this->component = (new DatetimePicker())->withName('datetime-picker');
});

test('it should have array properties', function () {
    $packs = $this->invokeProperty($this->component, 'packs');

    expect($packs)->toBe(['shadow']);

    $props = $this->invokeProperty($this->component, 'props');

    expect($props)->toBe([
        'max' => null,
        'min' => null,
        'interval' => 10,
        'max-time' => 24,
        'min-time' => 0,
        'multiple' => false,
        'timezone' => null,
        'clearable' => true,
        'right-icon' => 'calendar',
        'shadowless' => false,
        'time-format' => 12,
        'multiple-max' => 0,
        'parse-format' => null,
        'without-time' => false,
        'without-tips' => false,
        'allowed-dates' => [],
        'start-of-week' => Carbon::SUNDAY,
        'user-timezone' => null,
        'disabled-dates' => [],
        'disabled-years' => [],
        'display-format' => null,
        'disabled-months' => [],
        'without-timezone' => false,
        'disabled-weekdays' => [],
        'disable-past-dates' => false,
        'without-time-seconds' => false,
        'requires-confirmation' => false,
    ]);
});

test('it should have properties in component', function () {
    $this->runWireUiComponent($this->component);

    expect($this->component)->toHaveProperties([
        // Props
        'max',
        'min',
        'maxTime',
        'minTime',
        'interval',
        'multiple',
        'timezone',
        'clearable',
        'rightIcon',
        'shadowless',
        'timeFormat',
        'multipleMax',
        'parseFormat',
        'startOfWeek',
        'withoutTime',
        'withoutTips',
        'allowedDates',
        'userTimezone',
        'displayFormat',
        'disabledDates',
        'disabledYears',
        'disabledMonths',
        'withoutTimezone',
        'disabledWeekdays',
        'disablePastDates',
        'withoutTimeSeconds',
        'requiresConfirmation',
        // Packs
        'color',
        'shadow',
        'rounded',
        'squared',
        'colorClasses',
        'shadowClasses',
        'roundedClasses',
    ]);

    expect($this->component->shadowless)->toBeFalse();
});

test('it should set random color in component', function () {
    $pack = $this->getRandomPack(Color::class);

    $this->setAttributes($this->component, [
        'color' => $color = data_get($pack, 'key'),
    ]);

    $this->runWireUiComponent($this->component);

    $class = data_get($pack, 'class');

    expect($this->component->color)->toBe($color);
    expect($this->component->colorClasses)->toBe($class);

    expect('<x-datetime-picker :$color />')
        ->render(compact('color'))
        ->toContain(data_get($class, 'input'));
});

test('it should set random shadow in component', function () {
    $pack = $this->getRandomPack(Shadow::class);

    $this->setAttributes($this->component, [
        'shadow' => $shadow = data_get($pack, 'key'),
    ]);

    $this->runWireUiComponent($this->component);

    $class = data_get($pack, 'class');

    expect($this->component->shadow)->toBe($shadow);
    expect($this->component->shadowless)->toBeFalse();
    expect($this->component->shadowClasses)->toBe($class);

    expect('<x-datetime-picker :$shadow />')->render(compact('shadow'))->toContain($class);
});

test('it should set random rounded in component', function () {
    $pack = $this->getRandomPack(Rounded::class);

    $this->setAttributes($this->component, [
        'rounded' => $rounded = data_get($pack, 'key'),
    ]);

    $this->runWireUiComponent($this->component);

    $class = data_get($pack, 'class');

    expect($this->component->squared)->toBeFalse();
    expect($this->component->rounded)->toBe($rounded);
    expect($this->component->roundedClasses)->toBe($class);

    expect('<x-datetime-picker :$rounded />')
        ->render(compact('rounded'))
        ->toContain(data_get($class, 'input'));
});
 ?>

Did this file decode correctly?

Original Code

<?php

namespace WireUi\Components\DatetimePicker\tests\Unit;

use Illuminate\Support\Carbon;
use WireUi\Components\DatetimePicker\Picker as DatetimePicker;
use WireUi\Components\Wrapper\WireUi\Color;
use WireUi\Components\Wrapper\WireUi\Rounded;
use WireUi\WireUi\Shadow;

beforeEach(function () {
    $this->component = (new DatetimePicker())->withName('datetime-picker');
});

test('it should have array properties', function () {
    $packs = $this->invokeProperty($this->component, 'packs');

    expect($packs)->toBe(['shadow']);

    $props = $this->invokeProperty($this->component, 'props');

    expect($props)->toBe([
        'max' => null,
        'min' => null,
        'interval' => 10,
        'max-time' => 24,
        'min-time' => 0,
        'multiple' => false,
        'timezone' => null,
        'clearable' => true,
        'right-icon' => 'calendar',
        'shadowless' => false,
        'time-format' => 12,
        'multiple-max' => 0,
        'parse-format' => null,
        'without-time' => false,
        'without-tips' => false,
        'allowed-dates' => [],
        'start-of-week' => Carbon::SUNDAY,
        'user-timezone' => null,
        'disabled-dates' => [],
        'disabled-years' => [],
        'display-format' => null,
        'disabled-months' => [],
        'without-timezone' => false,
        'disabled-weekdays' => [],
        'disable-past-dates' => false,
        'without-time-seconds' => false,
        'requires-confirmation' => false,
    ]);
});

test('it should have properties in component', function () {
    $this->runWireUiComponent($this->component);

    expect($this->component)->toHaveProperties([
        // Props
        'max',
        'min',
        'maxTime',
        'minTime',
        'interval',
        'multiple',
        'timezone',
        'clearable',
        'rightIcon',
        'shadowless',
        'timeFormat',
        'multipleMax',
        'parseFormat',
        'startOfWeek',
        'withoutTime',
        'withoutTips',
        'allowedDates',
        'userTimezone',
        'displayFormat',
        'disabledDates',
        'disabledYears',
        'disabledMonths',
        'withoutTimezone',
        'disabledWeekdays',
        'disablePastDates',
        'withoutTimeSeconds',
        'requiresConfirmation',
        // Packs
        'color',
        'shadow',
        'rounded',
        'squared',
        'colorClasses',
        'shadowClasses',
        'roundedClasses',
    ]);

    expect($this->component->shadowless)->toBeFalse();
});

test('it should set random color in component', function () {
    $pack = $this->getRandomPack(Color::class);

    $this->setAttributes($this->component, [
        'color' => $color = data_get($pack, 'key'),
    ]);

    $this->runWireUiComponent($this->component);

    $class = data_get($pack, 'class');

    expect($this->component->color)->toBe($color);
    expect($this->component->colorClasses)->toBe($class);

    expect('<x-datetime-picker :$color />')
        ->render(compact('color'))
        ->toContain(data_get($class, 'input'));
});

test('it should set random shadow in component', function () {
    $pack = $this->getRandomPack(Shadow::class);

    $this->setAttributes($this->component, [
        'shadow' => $shadow = data_get($pack, 'key'),
    ]);

    $this->runWireUiComponent($this->component);

    $class = data_get($pack, 'class');

    expect($this->component->shadow)->toBe($shadow);
    expect($this->component->shadowless)->toBeFalse();
    expect($this->component->shadowClasses)->toBe($class);

    expect('<x-datetime-picker :$shadow />')->render(compact('shadow'))->toContain($class);
});

test('it should set random rounded in component', function () {
    $pack = $this->getRandomPack(Rounded::class);

    $this->setAttributes($this->component, [
        'rounded' => $rounded = data_get($pack, 'key'),
    ]);

    $this->runWireUiComponent($this->component);

    $class = data_get($pack, 'class');

    expect($this->component->squared)->toBeFalse();
    expect($this->component->rounded)->toBe($rounded);
    expect($this->component->roundedClasses)->toBe($class);

    expect('<x-datetime-picker :$rounded />')
        ->render(compact('rounded'))
        ->toContain(data_get($class, 'input'));
});

Function Calls

None

Variables

None

Stats

MD5 30bcd5e5ad71588db6d967683fd3ff5d
Eval Count 0
Decode Time 96 ms