Método DSL Gradle no encontrado: prueba ()

Intenté agregar el siguiente código al final de mibuild.gradle archivo en Android-Studio 1.2 (como se recomienda enesta publicación):

test {
    testLogging {
        events "passed", "skipped", "failed", "standardOut", "standardError"
    }
}

Pero tengo:

Error:(40, 0) Gradle DSL method not found: 'test()'
Possible causes:
- The project 'xxxxx' may be using a version of Gradle that does not contain the method.
- The build file may be missing a Gradle plugin.

¿Qué me perdí?

Respuestas a la pregunta(1)

Su respuesta a la pregunta