mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-06 16:51:37 +00:00
Add Kotlin port of the logout plugin
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
name = "logout"
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
val LOGOUT_BUTTON_ID = 2458
|
||||||
|
|
||||||
|
on_button(LOGOUT_BUTTON_ID)
|
||||||
|
.where { widgetId == LOGOUT_BUTTON_ID }
|
||||||
|
.then { it.logout() }
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import org.apollo.game.message.impl.ButtonMessage
|
||||||
|
import org.apollo.game.plugin.testing.KotlinPluginTest
|
||||||
|
import org.junit.Test
|
||||||
|
import org.mockito.Mockito.times
|
||||||
|
import org.mockito.Mockito.verify
|
||||||
|
|
||||||
|
class LogoutTests : KotlinPluginTest() {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val LOGOUT_BUTTON_ID = 2458
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test fun `The player should be logged out when they click the logout button`() {
|
||||||
|
player.notify(ButtonMessage(LOGOUT_BUTTON_ID))
|
||||||
|
|
||||||
|
verify(player, times(1)).logout()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user