From 59ae174d2be81e7cdbfcf0159a0e27966f4a633f Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 4 Jun 2015 13:58:20 +0200 Subject: [PATCH] Added a test. --- .../sets/avacynrestored/ButcherGhoul.java | 1 + .../test/cards/copy/PhantasmalImageTest.java | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/Mage.Sets/src/mage/sets/avacynrestored/ButcherGhoul.java b/Mage.Sets/src/mage/sets/avacynrestored/ButcherGhoul.java index cf186b902ab..4c705d5594b 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/ButcherGhoul.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/ButcherGhoul.java @@ -48,6 +48,7 @@ public class ButcherGhoul extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); + // Undying (When this creature dies, if it had no +1/+1 counters on it, return it to the battlefield under its owner's control with a +1/+1 counter on it.) this.addAbility(new UndyingAbility()); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhantasmalImageTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhantasmalImageTest.java index deb1e8b99f9..7cd0d98e3b0 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhantasmalImageTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhantasmalImageTest.java @@ -483,4 +483,47 @@ public class PhantasmalImageTest extends CardTestPlayerBase { assertPowerToughness(playerB, "Kitchen Finks", 2, 1); } + + @Test + public void testUndying() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2); + // Undying (When this creature dies, if it had no +1/+1 counters on it, return it to the battlefield under its owner's control with a +1/+1 counter on it.) + addCard(Zone.HAND, playerA, "Butcher Ghoul"); + + // Destroy target creature an opponent controls. Each other creature that player controls gets -2/-0 until end of turn. + addCard(Zone.HAND, playerA, "Public Execution"); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 6); + + addCard(Zone.BATTLEFIELD, playerB, "Island", 2); + + // You may have Phantasmal Image enter the battlefield as a copy of any creature + // on the battlefield, except it's an Illusion in addition to its other types and + // it gains "When this creature becomes the target of a spell or ability, sacrifice it." + addCard(Zone.HAND, playerB, "Phantasmal Image"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Butcher Ghoul"); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Phantasmal Image"); // not targeted + setChoice(playerB, "Butcher Ghoul"); + + + castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerA, "Public Execution", "Butcher Ghoul"); + setChoice(playerB, "Butcher Ghoul"); + + setStopAt(2, PhaseStep.END_TURN); + execute(); + + assertGraveyardCount(playerA, "Public Execution", 1); + + assertLife(playerA, 20); + assertLife(playerB, 20); + + assertPermanentCount(playerA, "Butcher Ghoul", 1); + + assertHandCount(playerB, "Phantasmal Image", 0); + assertGraveyardCount(playerB, "Phantasmal Image", 0); + assertPermanentCount(playerB, "Butcher Ghoul", 1); + assertPowerToughness(playerB, "Butcher Ghoul", 2, 2); + + } }