<commit_before><?php

declare(strict_types=1);

/*
 * This file is part of the ************************ package.
 * _____________                           _______________
 *  ______/     \__  _____  ____  ______  / /_  _________
 *   ____/ __   / / / / _ \/ __`\/ / __ \/ __ \/ __ \___
 *    __/ / /  / /_/ /  __/ /  \  / /_/ / / / / /_/ /__
 *      \_\ \_/\____/\___/_/   / / .___/_/ /_/ .___/
 *         \_\                /_/_/         /_/
 *
 * The PHP Framework For Code Poem As Free As Wind. <Query Yet Simple>
 * (c) 2010-2020 http://queryphp.com All rights reserved.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Tests\Filesystem;

use League\Flysystem\Filesystem as LeagueFilesystem;
use Leevel\Filesystem\Zip;
use Tests\TestCase;

class ZipTest extends TestCase
{
    public function testBaseUse(): void
    {
        $zip = new Zip([
            'path' => $path = __DIR__.'/hello.zip',
        ]);
        $this->assertInstanceof(LeagueFilesystem::class, $zip->getFilesystem());

        $zip->put('hello.txt', 'foo');
        $this->assertTrue(is_file($path));
        unlink($path);
    }<commit_msg>tests(filesystem): fix zip tests<commit_after><?php

declare(strict_types=1);

/*
 * This file is part of the ************************ package.
 * _____________                           _______________
 *  ______/     \__  _____  ____  ______  / /_  _________
 *   ____/ __   / / / / _ \/ __`\/ / __ \/ __ \/ __ \___
 *    __/ / /  / /_/ /  __/ /  \  / /_/ / / / / /_/ /__
 *      \_\ \_/\____/\___/_/   / / .___/_/ /_/ .___/
 *         \_\                /_/_/         /_/
 *
 * The PHP Framework For Code Poem As Free As Wind. <Query Yet Simple>
 * (c) 2010-2020 http://queryphp.com All rights reserved.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Tests\Filesystem;

use League\Flysystem\Filesystem as LeagueFilesystem;
use Leevel\Filesystem\Zip;
use Tests\TestCase;

class ZipTest extends TestCase
{
    protected function setUp(): void
    {
        $file = __DIR__.'/hello.zip';
        if (is_file($file)) {
            unlink($file);
        }
    }

    protected function tearDown(): void
    {
        $this->setUp();
    }

    public function testBaseUse(): void
    {
        $zip = new Zip([
            'path' => $path = __DIR__.'/hello.zip',
        ]);
        $this->assertInstanceof(LeagueFilesystem::class, $zip->getFilesystem());

        $zip->put('hello.txt', 'foo');
    }
{'fraction_non_alphanumeric': 0.16507085407889696, 'fraction_numerical': 0.0068939103791650705, 'mean_word_length': 1.8577680525164113, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6788102', 'n_tokens_mistral': 865, 'n_tokens_neox': 816, 'n_words': 169}