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\Integration\Models; use App\Models\Song; use App\Models\SongZipArc..

Decoded Output download

<?php

namespace Tests\Integration\Models;

use App\Models\Song;
use App\Models\SongZipArchive;
use Tests\TestCase;

class SongZipArchiveTest extends TestCase
{
    public function testAddSongIntoArchive(): void
    {
        /** @var Song $song */
        $song = Song::factory()->create(['path' => realpath(__DIR__ . '/../../songs/full.mp3')]);

        $songZipArchive = new SongZipArchive();
        $songZipArchive->addSong($song);

        self::assertSame(1, $songZipArchive->getArchive()->numFiles);
        self::assertSame('full.mp3', $songZipArchive->getArchive()->getNameIndex(0));
    }

    public function testAddMultipleSongsIntoArchive(): void
    {
        $songs = collect([
            Song::factory()->create(['path' => realpath(__DIR__ . '/../../songs/full.mp3')]),
            Song::factory()->create(['path' => realpath(__DIR__ . '/../../songs/lorem.mp3')]),
        ]);

        $songZipArchive = new SongZipArchive();
        $songZipArchive->addSongs($songs);

        self::assertSame(2, $songZipArchive->getArchive()->numFiles);
        self::assertSame('full.mp3', $songZipArchive->getArchive()->getNameIndex(0));
        self::assertSame('lorem.mp3', $songZipArchive->getArchive()->getNameIndex(1));
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Tests\Integration\Models;

use App\Models\Song;
use App\Models\SongZipArchive;
use Tests\TestCase;

class SongZipArchiveTest extends TestCase
{
    public function testAddSongIntoArchive(): void
    {
        /** @var Song $song */
        $song = Song::factory()->create(['path' => realpath(__DIR__ . '/../../songs/full.mp3')]);

        $songZipArchive = new SongZipArchive();
        $songZipArchive->addSong($song);

        self::assertSame(1, $songZipArchive->getArchive()->numFiles);
        self::assertSame('full.mp3', $songZipArchive->getArchive()->getNameIndex(0));
    }

    public function testAddMultipleSongsIntoArchive(): void
    {
        $songs = collect([
            Song::factory()->create(['path' => realpath(__DIR__ . '/../../songs/full.mp3')]),
            Song::factory()->create(['path' => realpath(__DIR__ . '/../../songs/lorem.mp3')]),
        ]);

        $songZipArchive = new SongZipArchive();
        $songZipArchive->addSongs($songs);

        self::assertSame(2, $songZipArchive->getArchive()->numFiles);
        self::assertSame('full.mp3', $songZipArchive->getArchive()->getNameIndex(0));
        self::assertSame('lorem.mp3', $songZipArchive->getArchive()->getNameIndex(1));
    }
}

Function Calls

None

Variables

None

Stats

MD5 18ed62671e13bf50aa33c41328d3dc79
Eval Count 0
Decode Time 123 ms