From 028ea0e04c26240a590a83445773980ca19c8630 Mon Sep 17 00:00:00 2001 From: 18ths <13023067+18ths@users.noreply.github.com> Date: Sun, 21 Jun 2020 20:00:53 +0200 Subject: [PATCH] added test for copy anthem effect issue --- .../test/rollback/CopyAnthemEffectTest.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Mage.Tests/src/test/java/org/mage/test/rollback/CopyAnthemEffectTest.java diff --git a/Mage.Tests/src/test/java/org/mage/test/rollback/CopyAnthemEffectTest.java b/Mage.Tests/src/test/java/org/mage/test/rollback/CopyAnthemEffectTest.java new file mode 100644 index 0000000000..787559a83c --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/rollback/CopyAnthemEffectTest.java @@ -0,0 +1,38 @@ +package org.mage.test.rollback; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +public class CopyAnthemEffectTest extends CardTestPlayerBase { + + // Addresses issue #6618 - Creatures get +1/+1 when we cancel the cast of a spell + + // Creatures of one player get +1/+1 every time someone cancel the cast of a spell. + // Looks like the repeating effect was Force Of Virtue's static ability + // There was also a Mirrormade cast to copy Force of Virtue + + // Further investigation shown that the problem could be also reduced to any anthem effect copied by other permanent, then rollbacking + @Test + public void copyAnthemEffect() { + addCard(Zone.BATTLEFIELD, playerA, "Runeclaw Bear"); // 2/2 vanilla creature + addCard(Zone.BATTLEFIELD, playerA, "Glorious Anthem"); // creatures you control have +1/+1 + addCard(Zone.BATTLEFIELD, playerA, "Island", 3); + + addCard(Zone.HAND, playerA, "Copy Enchantment"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Copy Enchantment"); + setChoice(playerA, "Yes"); + setChoice(playerA, "Glorious Anthem"); + + rollbackTurns(3, PhaseStep.UPKEEP, playerA, 0); + + setStopAt(3, PhaseStep.BEGIN_COMBAT); + execute(); + assertAllCommandsUsed(); + + assertPowerToughness(playerA, "Runeclaw Bear", 4, 4); + } + +}