assertEquals($expectedResult, in_array($value, $haystack)); } } public function testCreateActionTrue(): void { $subset = [Request::METHOD_POST, Request::METHOD_HEAD]; $action = ActionType::CREATE; $haystack = ActionHttpMethodMap::getHttpMethods($action); $this->assertSubsetInArray($subset, $haystack, true); $this->assertEquals(2, count($haystack)); } public function testCreateActionFalse(): void { $subset = [Request::METHOD_POST, Request::METHOD_HEAD]; $action = 'wrong value'; $haystack = ActionHttpMethodMap::getHttpMethods($action); $this->assertSubsetInArray($subset, $haystack, false); } public function testPostMethodTrue(): void { $subset = [ActionType::READ]; $httpMethod = Request::METHOD_GET; $haystack = ActionHttpMethodMap::getActions($httpMethod); $this->assertSubsetInArray($subset, $haystack, true); } public function testPostMethodFalse(): void { $subset = [ActionType::READ]; $httpMethod = 'wrong value'; $haystack = ActionHttpMethodMap::getActions($httpMethod); $this->assertSubsetInArray($subset, $haystack, false); } }