public void testEnterDefinitionNode() { MutatingVisitController visitController = createMock(MutatingVisitController.class); CssTree tree = createMock(CssTree.class); expect(tree.getMutatingVisitController()).andReturn(visitController).anyTimes(); // We need to have this replayed because in the constructor of // ReplaceConstantReferences pass we need tree.getMutatingVisitController(). replay(tree); ReplaceConstantReferences pass = new ReplaceConstantReferences( tree, new ConstantDefinitions(), true /* removeDefs */, new DummyErrorManager(), true /* allowUndefinedConstants */); visitController.removeCurrentNode(); replay(visitController); CssDefinitionNode node = new CssDefinitionNode(new CssLiteralNode("COLOR")); pass.enterDefinition(node); verify(visitController); }