<commit_before><?php
declare(strict_types=1);

class MoveTest extends PHPUnit_Framework_TestCase
{
    public function testMove()
    {
        $room1 = new \PhpMud\Entity\Room();
        $room2 = new \PhpMud\Entity\Room();
        $direction1 = new \PhpMud\Entity\Direction($room1, \PhpMud\Enum\Direction::NORTH(), $room2);
        $room1->getDirections()->add($direction1);
        $direction2 = new \PhpMud\Entity\Direction($room2, \PhpMud\Enum\Direction::SOUTH(), $room1);
        $room2->getDirections()->add($direction2);

        $mob = new \PhpMud\Entity\Mob('test mob');
        $room1->getMobs()->add($mob);
        $mob->setRoom($room1);
        $input = new \PhpMud\Input($mob);

        $command = new \PhpMud\Command\North();
        $output = $command->execute($input);

        static::assertEquals(\PhpMud\Enum\CommandResult::SUCCESS(), $output->getCommandResult());
        static::assertEquals($room2, $mob->getRoom());

        $command = new \PhpMud\Command\South();
        $command->execute($input);

        static::assertEquals(\PhpMud\Enum\CommandResult::SUCCESS(), $output->getCommandResult());
        static::assertEquals($room1, $mob->getRoom());

        $output = $command->execute($input);

        static::assertEquals(\PhpMud\Enum\CommandResult::FAILURE(), $output->getCommandResult());
    }
}<commit_msg>:white_check_mark: data provider for tests<commit_after><?php
declare(strict_types=1);

class MoveTest extends PHPUnit_Framework_TestCase
{
    /**
     * @dataProvider moveDataProvider
     *
     * @param \PhpMud\Enum\Direction $direction
     * @param \PhpMud\Command $commandLeave
     * @param \PhpMud\Command $commandReturn
     */
    public function testMove(\PhpMud\Enum\Direction $direction, \PhpMud\Command $commandLeave, \PhpMud\Command $commandReturn)
    {
        $room1 = new \PhpMud\Entity\Room();
        $room2 = new \PhpMud\Entity\Room();
        $direction1 = new \PhpMud\Entity\Direction($room1, $direction, $room2);
        $room1->getDirections()->add($direction1);
        $direction2 = new \PhpMud\Entity\Direction($room2, $direction->reverse(), $room1);
        $room2->getDirections()->add($direction2);

        $mob = new \PhpMud\Entity\Mob('test mob');
        $room1->getMobs()->add($mob);
        $mob->setRoom($room1);
        $input = new \PhpMud\Input($mob);

        $output = $commandLeave->execute($input);

        static::assertEquals(\PhpMud\Enum\CommandResult::SUCCESS(), $output->getCommandResult());
        static::assertEquals($room2, $mob->getRoom());

        $commandReturn->execute($input);

        static::assertEquals(\PhpMud\Enum\CommandResult::SUCCESS(), $output->getCommandResult());
        static::assertEquals($room1, $mob->getRoom());

        $output = $commandReturn->execute($input);

        static::assertEquals(\PhpMud\Enum\CommandResult::FAILURE(), $output->getCommandResult());
    }

    public function moveDataProvider()
    {
        return [
            [
                \PhpMud\Enum\Direction::NORTH(),
                new \PhpMud\Command\North(),
                new \PhpMud\Command\South()
            ],
            [
                \PhpMud\Enum\Direction::SOUTH(),
                new \PhpMud\Command\South(),
                new \PhpMud\Command\North()
            ],
            [
                \PhpMud\Enum\Direction::EAST(),
                new \PhpMud\Command\East(),
                new \PhpMud\Command\West()
            ],
            [
                \PhpMud\Enum\Direction::WEST(),
                new \PhpMud\Command\West(),
                new \PhpMud\Command\East()
            ],
            [
                \PhpMud\Enum\Direction::UP(),
                new \PhpMud\Command\Up(),
                new \PhpMud\Command\Down()
            ],
            [
                \PhpMud\Enum\Direction::DOWN(),
                new \PhpMud\Command\Down(),
                new \PhpMud\Command\Up()
            ]
        ];
    }
}
{'fraction_non_alphanumeric': 0.16270843860535625, 'fraction_numerical': 0.008590197069226882, 'mean_word_length': 2.261120263591433, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 34, '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': '4862504', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1197, 'n_words': 162}