Code Duplication    Length = 12-12 lines in 2 locations

Tests/Units/Command/CommandBusTests.php 2 locations

@@ 47-58 (lines=12) @@
44
    /**
45
     * Test dispatch chained middlewares.
46
     */
47
    public function testDispatchChainedMiddlewares()
48
    {
49
        $this
50
            ->given($commandBus = CommandBus::create())
51
            ->and($command = new EncodePasswordCommand('plainpassword'))
52
            ->and($commandBus->addHandler(EncodePasswordCommand::class, new EncodePasswordHandler('md5')))
53
            ->and($commandBus->dispatch($command))
54
            ->then()
55
                ->string($command->password())
56
                    ->isEqualTo(md5('plainpassword'))
57
        ;
58
    }
59
60
    /**
61
     * Test getHandlerFor.
@@ 63-74 (lines=12) @@
60
    /**
61
     * Test getHandlerFor.
62
     */
63
    public function testGetHandlerFor()
64
    {
65
        $this
66
            ->given($commandBus = CommandBus::create())
67
            ->and($command = new EncodePasswordCommand('plainpassword'))
68
            ->and($commandHandler = new EncodePasswordHandler('md5'))
69
            ->and($commandBus->addHandler(EncodePasswordCommand::class, $commandHandler))
70
            ->then()
71
                ->object($commandBus->getHandlerFor(EncodePasswordCommand::class))
72
                    ->isEqualTo($commandHandler)
73
        ;
74
    }
75
76
    /**
77
     * Test getHandlerMethodFor.