<?php

app_require('modules/slack/config/slack_internal_department_ids_c.php');

use slack\config\slack_internal_department_ids_c;

it('normalizes configured Slack internal department ids', function (): void {
    expect(slack_internal_department_ids_c::normalizeDepartmentIds([3, '2', 2, 0, -1, 'abc', 1]))
        ->toBe([1, 2, 3])
        ->and(slack_internal_department_ids_c::normalizeDepartmentIds('[7, "5", 5]'))
        ->toBe([5, 7])
        ->and(slack_internal_department_ids_c::normalizeDepartmentIds('4, 2, invalid'))
        ->toBe([2, 4])
        ->and(slack_internal_department_ids_c::normalizeDepartmentIds('not-json'))
        ->toBe([]);
});
