* Fixed a bug of CastOnlyDuringPhaseStepSourceEffect that allowed players to cast spells in not allowed phases/steps (e.g. Chaotic Strike and Aleatory).

This commit is contained in:
LevelX2 2016-02-02 15:01:03 +01:00
parent 7b326685c1
commit 43460c1256
2 changed files with 36 additions and 4 deletions

View file

@ -165,4 +165,33 @@ public class CantCastTest extends CardTestPlayerBase {
assertLife(playerB, 20);
}
/**
* Test that panic can only be cast during the correct pahse/steü
*/
@Test
public void testPanic() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
// Cast Panic only during combat before blockers are declared.
// Target creature can't block this turn.
// Draw a card at the beginning of the next turn's upkeep.
addCard(Zone.HAND, playerA, "Panic", 4); // Instant - {R}
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Panic", "Silvercoat Lion");
castSpell(1, PhaseStep.DECLARE_ATTACKERS, playerA, "Panic", "Silvercoat Lion");
castSpell(1, PhaseStep.DECLARE_BLOCKERS, playerA, "Panic", "Silvercoat Lion");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Panic", "Silvercoat Lion");
setStopAt(2, PhaseStep.PRECOMBAT_MAIN);
execute();
assertHandCount(playerA, "Panic", 3);
assertHandCount(playerA, 4);
assertGraveyardCount(playerA, "Panic", 1);
}
}