Skip to main content

PlayerMockCoreGuiUtils

The CoreGui events a mock stands in for. StarterGui:GetCore(coreName) answers some names with a BindableEvent the CoreGui fires -- the only notice production gets that a friendship changed -- and only a real client has one, so the mock keeps its own for a test to fire.

Reached through the "StarterGui.GetCore" method domain, so production asks for a core the same way against a mock as against the engine (see CoreGuiUtils.tryToGetCore).

Functions

getCoreEvent

PlayerMockCoreGuiUtils.getCoreEvent(
playerPlayer,--

must be a PlayerMock

coreNamestring--

a CoreGui event name, e.g. "PlayerFriendedEvent"

) → BindableEvent

Returns the mock's stand-in for a CoreGui event, created on first ask so a test and the production code observing it meet on the same BindableEvent whichever asks first.

Use PlayerMock.callMethod with "StarterGui.GetCore".

Show raw api
{
    "functions": [
        {
            "name": "getCoreEvent",
            "desc": "Returns the mock's stand-in for a CoreGui event, created on first ask so a test and the production\ncode observing it meet on the same BindableEvent whichever asks first.\n\nUse [PlayerMock.callMethod] with `\"StarterGui.GetCore\"`.",
            "params": [
                {
                    "name": "player",
                    "desc": "must be a PlayerMock",
                    "lua_type": "Player"
                },
                {
                    "name": "coreName",
                    "desc": "a CoreGui event name, e.g. \"PlayerFriendedEvent\"",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "BindableEvent"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 35,
                "path": "src/player-mock/src/Shared/Helpers/CoreGui/PlayerMockCoreGuiUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "PlayerMockCoreGuiUtils",
    "desc": "The CoreGui events a mock stands in for. `StarterGui:GetCore(coreName)` answers some names with a\nBindableEvent the CoreGui fires -- the only notice production gets that a friendship changed --\nand only a real client has one, so the mock keeps its own for a test to fire.\n\nReached through the `\"StarterGui.GetCore\"` method domain, so production asks for a core the same\nway against a mock as against the engine (see [CoreGuiUtils.tryToGetCore]).",
    "source": {
        "line": 12,
        "path": "src/player-mock/src/Shared/Helpers/CoreGui/PlayerMockCoreGuiUtils.lua"
    }
}