/** @test */ public function should_test_equality() { $one = NotificationId::fromString('d16f9fe7-e947-460e-99f6-2d64d65f46bc'); $two = NotificationId::fromString('d16f9fe7-e947-460e-99f6-2d64d65f46bc'); $three = NotificationId::generate(); $this->assertTrue($one->equals($two)); $this->assertFalse($one->equals($three)); }
/** @test */ public function should_create_notification() { $notification = new Notification(NotificationId::generate(), $this->user, new NewFollower(), 'hello world'); $this->assertInstanceOf('Cribbb\\Domain\\Model\\Identity\\Notification', $notification); $this->assertInstanceOf('Cribbb\\Domain\\Model\\Identity\\NotificationId', $notification->id()); $this->assertInstanceOf('Cribbb\\Domain\\Model\\Identity\\User', $notification->user()); $this->assertEquals('new_follower', $notification->type()); $this->assertEquals('hello world', $notification->body()); }