Code Duplication    Length = 12-12 lines in 2 locations

Tests/Units/Command/CommandBusTests.php 1 location

@@ 33-44 (lines=12) @@
30
    /**
31
     * Test create without command handler middleware.
32
     */
33
    public function testCreateWithoutCommandHandlerMiddleware()
34
    {
35
        $this
36
            ->given($middleware = new LockingMiddleware())
37
            ->and($commandBus = new CommandBus([$middleware]))
38
            ->then()
39
                ->exception(function () use ($commandBus) {
40
                    $commandBus->dispatch(new EncodePasswordCommand('plainpassword'));
41
                })
42
                ->isInstanceOf(NotFoundException::class)
43
        ;
44
    }
45
46
    /**
47
     * Test dispatch chained middlewares.

Tests/Units/Query/QueryBusTests.php 1 location

@@ 34-45 (lines=12) @@
31
    /**
32
     * Test create without query handler middleware.
33
     */
34
    public function testCreateWithoutQueryHandlerMiddleware()
35
    {
36
        $this
37
            ->given($middleware = new LockingMiddleware())
38
            ->and($queryBus = new QueryBus([$middleware]))
39
            ->then()
40
                ->exception(function () use ($queryBus) {
41
                    $queryBus->dispatch(new PublishedPostsQuery(new \DateTime()));
42
                })
43
                ->isInstanceOf(NotFoundException::class)
44
        ;
45
    }
46
47
    /**
48
     * Test dispatch chained middlewares.