<commit_before><?php

namespace InvertedOverworldGlitches;

use ALttP\Item;
use ALttP\World;
use TestCase;

/**
 * @group InvertedOverworldGlitches
 */
class EasternPalaceTest extends TestCase
{
    public function setUp(): void
    {
        parent::setUp();
        $this->world = World::factory('inverted', ['difficulty' => 'test_rules', 'logic' => 'OverworldGlitches']);
        $this->addCollected(['RescueZelda']);
        $this->collected->setChecksForWorld($this->world->id);
    }

    public function tearDown(): void
    {
        parent::tearDown();
        unset($this->world);
    }

    /**
     * @param string $location
     * @param bool $access
     * @param array $items
     * @param array $except
     *
     * @dataProvider accessPool
     */
    public function testLocation(string $location, bool $access, array $items, array $except = [])
    {
        if (count($except)) {
            $this->collected = $this->allItemsExcept($except);
        }

        $this->addCollected($items);

        $this->assertEquals($access, $this->world->getLocation($location)
            ->canAccess($this->collected));
    }

    /**
     * @param string $location
     * @param bool $access
     * @param string $item
     * @param array $items
     * @param array $except
     *
     * @dataProvider fillPool
     */
    public function testFillLocation(string $location, bool $access, string $item, array $items = [], array $except = [])
    {
        if (count($except)) {
            $this->collected = $this->allItemsExcept($except);
        }

        $this->addCollected($items);

        $this->assertEquals($access, $this->world->getLocation($location)
            ->fill(Item::get($item, $this->world), $this->collected));
    }

    public function fillPool()
    {
        return [
            ["Eastern Palace - Compass Chest", true, 'BigKeyP1', [], ['BigKeyP1']],

            ["Eastern Palace - Cannonball Chest", true, 'BigKeyP1', [], ['BigKeyP1']],

            ["Eastern Palace - Big Chest", false, 'BigKeyP1', [], ['BigKeyP1']],

            ["Eastern Palace - Map Chest", true, 'BigKeyP1', [], ['BigKeyP1']],

            ["Eastern Palace - Big Key Chest", true, 'BigKeyP1', [], ['BigKeyP1']],

            ["Eastern Palace - Boss", false, 'BigKeyP1', [], ['BigKeyP1']],
        ];
    }

    public function accessPool()
    {
        return [
            ["Eastern Palace - Compass Chest", false, []],
            ["Eastern Palace - Compass Chest", true, ['MoonPearl', 'PegasusBoots']],
            ["Eastern Palace - Compass Chest", true, ['MagicMirror', 'PegasusBoots']],
            ["Eastern Palace - Compass Chest", true, ['DefeatAgahnim']],

            ["Eastern Palace - Cannonball Chest", false, []],
            ["Eastern Palace - Compass Chest", true, ['MoonPearl', 'PegasusBoots']],
            ["Eastern Palace - Compass Chest", true, ['MagicMirror', 'PegasusBoots']],
            ["Eastern Palace - Compass Chest", true, ['DefeatAgahnim']],

            ["Eastern Palace - Big Chest", false, []],
            ["Eastern Palace - Big Chest", false, [], ['BigKeyP1']],
            ["Eastern Palace - Big Chest", true, ['BigKeyP1', 'MoonPearl', 'PegasusBoots']],
            ["Eastern Palace - Big Chest", true, ['BigKeyP1', 'MagicMirror', 'PegasusBoots']],
            ["Eastern Palace - Big Chest", true, ['BigKeyP1', 'DefeatAgahnim']],

            ["Eastern Palace - Map Chest", false, []],
            ["Eastern Palace - Compass Chest", true, ['MoonPearl', 'PegasusBoots']],
            ["Eastern Palace - Compass Chest", true, ['MagicMirror', 'PegasusBoots']],
            ["Eastern Palace - Compass Chest", true, ['DefeatAgahnim']],

            ["Eastern Palace - Big Key Chest", false, []],
            ["Eastern Palace - Big Key Chest", false, [], ['Lamp']],<commit_msg>Fix some copy/paste errors in the Inverted OWG tests.<commit_after><?php

namespace InvertedOverworldGlitches;

use ALttP\Item;
use ALttP\World;
use TestCase;

/**
 * @group InvertedOverworldGlitches
 */
class EasternPalaceTest extends TestCase
{
    public function setUp(): void
    {
        parent::setUp();
        $this->world = World::factory('inverted', ['difficulty' => 'test_rules', 'logic' => 'OverworldGlitches']);
        $this->addCollected(['RescueZelda']);
        $this->collected->setChecksForWorld($this->world->id);
    }

    public function tearDown(): void
    {
        parent::tearDown();
        unset($this->world);
    }

    /**
     * @param string $location
     * @param bool $access
     * @param array $items
     * @param array $except
     *
     * @dataProvider accessPool
     */
    public function testLocation(string $location, bool $access, array $items, array $except = [])
    {
        if (count($except)) {
            $this->collected = $this->allItemsExcept($except);
        }

        $this->addCollected($items);

        $this->assertEquals($access, $this->world->getLocation($location)
            ->canAccess($this->collected));
    }

    /**
     * @param string $location
     * @param bool $access
     * @param string $item
     * @param array $items
     * @param array $except
     *
     * @dataProvider fillPool
     */
    public function testFillLocation(string $location, bool $access, string $item, array $items = [], array $except = [])
    {
        if (count($except)) {
            $this->collected = $this->allItemsExcept($except);
        }

        $this->addCollected($items);

        $this->assertEquals($access, $this->world->getLocation($location)
            ->fill(Item::get($item, $this->world), $this->collected));
    }

    public function fillPool()
    {
        return [
            ["Eastern Palace - Compass Chest", true, 'BigKeyP1', [], ['BigKeyP1']],

            ["Eastern Palace - Cannonball Chest", true, 'BigKeyP1', [], ['BigKeyP1']],

            ["Eastern Palace - Big Chest", false, 'BigKeyP1', [], ['BigKeyP1']],

            ["Eastern Palace - Map Chest", true, 'BigKeyP1', [], ['BigKeyP1']],

            ["Eastern Palace - Big Key Chest", true, 'BigKeyP1', [], ['BigKeyP1']],

            ["Eastern Palace - Boss", false, 'BigKeyP1', [], ['BigKeyP1']],
        ];
    }

    public function accessPool()
    {
        return [
            ["Eastern Palace - Compass Chest", false, []],
            ["Eastern Palace - Compass Chest", true, ['MoonPearl', 'PegasusBoots']],
            ["Eastern Palace - Compass Chest", true, ['MagicMirror', 'PegasusBoots']],
            ["Eastern Palace - Compass Chest", true, ['DefeatAgahnim']],

            ["Eastern Palace - Cannonball Chest", false, []],
            ["Eastern Palace - Cannonball Chest", true, ['MoonPearl', 'PegasusBoots']],
            ["Eastern Palace - Cannonball Chest", true, ['MagicMirror', 'PegasusBoots']],
            ["Eastern Palace - Cannonball Chest", true, ['DefeatAgahnim']],

            ["Eastern Palace - Big Chest", false, []],
            ["Eastern Palace - Big Chest", false, [], ['BigKeyP1']],
            ["Eastern Palace - Big Chest", true, ['BigKeyP1', 'MoonPearl', 'PegasusBoots']],
            ["Eastern Palace - Big Chest", true, ['BigKeyP1', 'MagicMirror', 'PegasusBoots']],
            ["Eastern Palace - Big Chest", true, ['BigKeyP1', 'DefeatAgahnim']],

            ["Eastern Palace - Map Chest", false, []],
            ["Eastern Palace - Map Chest", true, ['MoonPearl', 'PegasusBoots']],
            ["Eastern Palace - Map Chest", true, ['MagicMirror', 'PegasusBoots']],
            ["Eastern Palace - Map Chest", true, ['DefeatAgahnim']],

            ["Eastern Palace - Big Key Chest", false, []],
            ["Eastern Palace - Big Key Chest", false, [], ['Lamp']],
{'fraction_non_alphanumeric': 0.17015740861194223, 'fraction_numerical': 0.004162872381943541, 'mean_word_length': 2.544490548639926, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '3951008', 'n_tokens_mistral': 2409, 'n_tokens_neox': 2259, 'n_words': 561}