<commit_before><?php

namespace Test\League\Tactician\Container;

use League\Container\Container;
use League\Tactician\Container\ContainerLocator;
use PHPUnit_Framework_TestCase;
use Test\League\Tactician\Container\Fixtures\Commands\CompleteTaskCommand;
use Test\League\Tactician\Container\Fixtures\Commands\UpdateProfileCommand;

class ContainerLocatorTest extends PHPUnit_Framework_TestCase
{
    /** @var  ContainerLocator */
    private $containerLocator;

    protected function setUp()
    {
        $dic = [
            'di' => [
                'Mailer' => [
                    'class' => 'Test\League\Tactician\Container\Fixtures\Container\Mailer',
                ],
                'NonExistentDependancy' => [
                    'class' => 'A\Made\Up\Namespace',
                ],
                'CompleteTaskCommandHandler' => [
                    'class' => 'Test\League\Tactician\Container\Fixtures\Command\CompleteTaskCommand',
                    'arguments' => [
                        'Mailer',
                    ],
                ],
            ],
        ];

        $mapping = [
            'Test\League\Tactician\Container\Fixtures\Commands\CompleteTaskCommand' =>
                'Test\League\Tactician\Container\Fixtures\Handlers\CompleteTaskCommandHandler',
        ];

        $this->containerLocator = new ContainerLocator(
            new Container($dic),
            $mapping
        );
    }

    public function testHandlerIsReturnedForSpecificClass()
    {
        $this
            ->assertInstanceOf(
                'Test\League\Tactician\Container\Fixtures\Handlers\CompleteTaskCommandHandler',
                $this->containerLocator->getHandlerForCommand(new CompleteTaskCommand)
            );
    }
}
<commit_msg>Updated tests as per issue #1<commit_after><?php

namespace Test\League\Tactician\Container;

use League\Container\Container;
use League\Tactician\Container\ContainerLocator;
use PHPUnit_Framework_TestCase;
use Test\League\Tactician\Container\Fixtures\Commands\CompleteTaskCommand;
use Test\League\Tactician\Container\Fixtures\Commands\DeleteTaskCommand;
use Test\League\Tactician\Container\Fixtures\Commands\UpdateProfileCommand;
use Test\League\Tactician\Container\Fixtures\Container\Mailer;
use Test\League\Tactician\Container\Fixtures\Handlers\CompleteTaskCommandHandler;

class ContainerLocatorTest extends PHPUnit_Framework_TestCase
{
    /** @var  ContainerLocator */
    private $containerLocator;

    protected function setUp()
    {
        $dic = [
            'di' => [
                'Mailer' => [
                    'class' => Mailer::class,
                ],
                'CompleteTaskCommandHandler' => [
                    'class' => CompleteTaskCommand::class,
                    'arguments' => [
                        'Mailer',
                    ],
                ],
            ],
        ];

        $mapping = [
            CompleteTaskCommand::class => CompleteTaskCommandHandler::class,
        ];

        $this->containerLocator = new ContainerLocator(
            new Container($dic),
            $mapping
        );
    }

    /**
     * @codeCoverage League\Tactician\Container::getHandlerForCommand
     */
    public function testHandlerIsReturnedForSpecificClass()
    {
        $this
            ->assertInstanceOf(
                CompleteTaskCommandHandler::class,
                $this->containerLocator->getHandlerForCommand(new CompleteTaskCommand)
            );
    }

    /**
     * @codeCoverage League\Tactician\Container::getHandlerForCommand
     * @codeCoverage League\Tactician\Container\Exception\MissingCommandException
     *
     * @expectedException League\Tactician\Container\Exception\MissingCommandException
     */
    public function testMissingCommandException()
    {
        $this->containerLocator->getHandlerForCommand(new DeleteTaskCommand());
    }
}

{'fraction_non_alphanumeric': 0.10174717368961973, 'fraction_numerical': 0.00025693730729701953, 'mean_word_length': 2.185761047463175, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, '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': '4987346', 'n_tokens_mistral': 1042, 'n_tokens_neox': 994, 'n_words': 129}