mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 12:31:59 -08:00
Test framework: added support to test client side data in unit tests (getGameView -> CardView, etc);
This commit is contained in:
parent
26fea5d07b
commit
fc0ff6c22d
7 changed files with 59 additions and 22 deletions
|
|
@ -3185,8 +3185,8 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
@Override
|
||||
public void cheat(UUID ownerId, List<Card> library, List<Card> hand, List<PermanentCard> battlefield, List<Card> graveyard, List<Card> command) {
|
||||
// fake test ability for triggers and events
|
||||
Ability fakeSourceAbility = new SimpleStaticAbility(Zone.OUTSIDE, new InfoEffect("adding testing cards"));
|
||||
fakeSourceAbility.setControllerId(ownerId);
|
||||
Ability fakeSourceAbilityTemplate = new SimpleStaticAbility(Zone.OUTSIDE, new InfoEffect("adding testing cards"));
|
||||
fakeSourceAbilityTemplate.setControllerId(ownerId);
|
||||
|
||||
Player player = getPlayer(ownerId);
|
||||
if (player != null) {
|
||||
|
|
@ -3221,6 +3221,8 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
}
|
||||
|
||||
for (PermanentCard permanentCard : battlefield) {
|
||||
Ability fakeSourceAbility = fakeSourceAbilityTemplate.copy();
|
||||
fakeSourceAbility.setSourceId(permanentCard.getId());
|
||||
CardUtil.putCardOntoBattlefieldWithEffects(fakeSourceAbility, this, permanentCard, player);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue