scimGroups = json_decode(file_get_contents(__DIR__ . '/../resources/filterTestGroups.json'), true); $this->scimUsers = json_decode(file_get_contents(__DIR__ . '/../resources/filterTestUsers.json'), true); } public function tearDown(): void { $this->scimGroups = []; $this->scimUsers = []; } public function testGroupFiltering() { // "ne" filter test $filterString = "displayName ne testGroup"; $filteredScimGroups = FilterUtil::performFiltering($filterString, $this->scimGroups); $this->assertEquals(array_splice($this->scimGroups, 1, 2), $filteredScimGroups); } public function testUserFiltering() { // "sw" filter test $filterString = "userName sw testuser"; $filteredScimUsers = FilterUtil::performFiltering($filterString, $this->scimUsers); $this->assertEquals($this->scimUsers, $filteredScimUsers); } public function testInvalidFiltering() { $this->expectException(FilterException::class); $this->expectExceptionMessage("Incorrectly formatted AttributeExpression"); $filterString = "externalId eq some value"; $filteredScimUsers = FilterUtil::performFiltering($filterString, $this->scimUsers); } }