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 Tests\Unit\Listeners; use App\Events\PlaybackStarted; use App\Listeners\..

Decoded Output download

<?php

namespace Tests\Unit\Listeners;

use App\Events\PlaybackStarted;
use App\Listeners\UpdateLastfmNowPlaying;
use App\Models\Song;
use App\Models\User;
use App\Services\LastfmService;
use Mockery;
use Tests\TestCase;

class UpdateLastfmNowPlayingTest extends TestCase
{
    public function testUpdateNowPlayingStatus(): void
    {
        /** @var User $user */
        $user = User::factory()->create();

        /** @var Song $song */
        $song = Song::factory()->create();

        $lastfm = Mockery::mock(LastfmService::class, ['enabled' => true]);

        $lastfm->shouldReceive('updateNowPlaying')
            ->with($song, $user)
            ->once();

        (new UpdateLastfmNowPlaying($lastfm))->handle(new PlaybackStarted($song, $user));
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Tests\Unit\Listeners;

use App\Events\PlaybackStarted;
use App\Listeners\UpdateLastfmNowPlaying;
use App\Models\Song;
use App\Models\User;
use App\Services\LastfmService;
use Mockery;
use Tests\TestCase;

class UpdateLastfmNowPlayingTest extends TestCase
{
    public function testUpdateNowPlayingStatus(): void
    {
        /** @var User $user */
        $user = User::factory()->create();

        /** @var Song $song */
        $song = Song::factory()->create();

        $lastfm = Mockery::mock(LastfmService::class, ['enabled' => true]);

        $lastfm->shouldReceive('updateNowPlaying')
            ->with($song, $user)
            ->once();

        (new UpdateLastfmNowPlaying($lastfm))->handle(new PlaybackStarted($song, $user));
    }
}

Function Calls

None

Variables

None

Stats

MD5 963bcbeccaf248a9d81075a0f11f619d
Eval Count 0
Decode Time 119 ms