/** * @covers \User\GitHub\LoginListener::onRegister */ public function testOnRegisterWithValidEvent() { $user = new User(); $profile = new Hybrid_User_Profile(); $photoUrl = 'http://placehold.it/50x50'; $profile->photoURL = $photoUrl; $profile->profileURL = 'https://github.com/username'; $event = new Event(null, null, ['user' => $user, 'userProfile' => $profile, 'provider' => 'github']); $this->listener->onRegister($event); $this->assertSame('username', $user->getUsername()); $this->assertSame($photoUrl, $user->getPhotoUrl()); }
/** * {@inheritDoc} */ public function getUsername() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getUsername', array()); return parent::getUsername(); }