Added toJson().
This commit is contained in:
parent
5550f076ca
commit
527530e89d
4 changed files with 12 additions and 3 deletions
|
@ -234,6 +234,15 @@ open class AkismetComment(val userIp: String, val userAgent: String) {
|
|||
serverEnv = buildServerEnv(request)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a JSON representation of the comment.
|
||||
*
|
||||
* @see [Akismet.jsonComment]
|
||||
*/
|
||||
fun toJson(): String {
|
||||
return toString()
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a JSON representation of the comment.
|
||||
*
|
||||
|
|
|
@ -130,7 +130,7 @@ class AkismetTest {
|
|||
isTest = true
|
||||
}
|
||||
|
||||
akismet.logger.info(mockComment.toString())
|
||||
akismet.logger.info(mockComment.toJson())
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue