Exemplo n.º 1
0
 function testDefaultAvatar()
 {
     $this->mockGlobalVariable('wgVignetteUrl', 'http://vignette.wikia-dev.com');
     $user = $this->getMock('User');
     $user->expects($this->any())->method('getGlobalPreference')->will($this->returnValue(null));
     $masthead = $this->getMock('Masthead', [], [$user]);
     $masthead->expects($this->any())->method('getDefaultAvatars')->will($this->returnValue(['http://images.wikia.com/messaging/images/1/19/Avatar.jpg']));
     $this->assertEquals('http://vignette.wikia-dev.com/messaging/images/1/19/Avatar.jpg/revision/latest/scale-to-width-down/150?cb=789&format=jpg', AvatarService::getVignetteUrl($masthead, 150, 789));
 }