PostDeletedOEventContract::createEvent()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace App\Tests\Modules\Posts\Contracts\Outbound;
4
5
use App\Modules\Posts\Domain\Dto\DeleteExistingPostDto;
6
use App\Modules\Posts\Domain\Event\Outbound\PostDeletedOEvent;
7
use App\Tests\TestUtils\Contracts\ApplicationOutboundEventContract;
8
use Symfony\Component\Uid\Ulid;
9
10
class PostDeletedOEventContract extends ApplicationOutboundEventContract
11
{
12
13
    public function testPostCreatedOEvent()
14
    {
15
        self::assertTrue(
16
            $this->verifyContracts($this->createEvent(), [
17
                'Comments/PostDeletedCommentsIEvent',
18
                'Tags/PostDeletedTagsIEvent',
19
            ])
20
        );
21
    }
22
23
    /**
24
     * @return PostDeletedOEvent
25
     */
26
    protected function createEvent(): PostDeletedOEvent
27
    {
28
        return new PostDeletedOEvent(new DeleteExistingPostDto(new Ulid()));
29
    }
30
}