public function testHandlerForEventUserCreated() { $id = Uuid::createNew(); $userName = '******'; $emailAddress = 'bar'; $fullName = 'baz boo'; $event = new UserCreated($id, $userName, $emailAddress, $fullName); $storage = $this->getMockBuilder(Storage::class)->disableOriginalConstructor()->getMock(); $storage->expects(self::once())->method('upsert')->with($id, self::anything()); $service = new UserService($storage); $service->onUserCreated($event); }