     # Construct a new test server with a configuration suitable for unit
     # testing.
     constructor: ->
-        config =
+        @config =
             modelBackend: "postgres"
             modelConfig:
                 host: "localhost"

                file: "test-suite.log"
            checkCreateNode: -> true
            autosubscribeNewUsers: []
        @server = server.startServer config

        # Cache IQs sent by the buddycloud server
        @iqs =

    send: (data) ->
        stanza = if data instanceof ltx.Element then data else ltx.parse data
        switch stanza.name
            when "presence"
                stanza.attrs.should.have.property "to"
                stanza.attrs.should.have.property "type"
                if stanza.attrs.type is "probe"
                    # Reply to presence probes. If the probed JID is a client,
                    # reply with 2 online resources: "abc" and "def".
                    to = stanza.attrs.from ? @config.xmpp.jid
                    bareFrom = stanza.attrs.to
                    if "@" in bareFrom
                        froms = [bareFrom + "/abc", bareFrom + "/def"]
                    else
                        froms = [bareFrom]
                    for from in froms
                        p = new ltx.Element("presence", from: from, to: to)
                        @emit "stanza", p.root()

            when "iq"
                stanza.attrs.should.have.property "from"
                stanza.attrs.should.have.property "to"
