finally { static::
assertTrue($exceptionWasThrown, 'Excepted exception with error code ' .
$errorCode . ' to be thrown.'
);
} } /**
* @return array<string, array{exception: SnippetException, statusCode: int, errorCode: string, message: string}>
*/
public static function exceptionDataProvider(): iterable
{ yield SnippetException::SNIPPET_DUPLICATED_FIRST_LEVEL_KEY_EXCEPTION =>
[ 'exception' => SnippetException::
duplicatedFirstLevelKey(['id1', 'id2', 'id3'
]),
'statusCode' => Response::HTTP_CONFLICT,
'errorCode' => SnippetException::SNIPPET_DUPLICATED_FIRST_LEVEL_KEY_EXCEPTION,
'message' => 'The following keys on the first level are duplicated and can not be overwritten: id1, id2, id3',
];
yield SnippetException::SNIPPET_EXTEND_OR_OVERWRITE_CORE_EXCEPTION =>
[ 'exception' => SnippetException::
extendOrOverwriteCore(['id1', 'id2', 'id3'
]),
'statusCode' => Response::HTTP_CONFLICT,
'errorCode' => SnippetException::SNIPPET_EXTEND_OR_OVERWRITE_CORE_EXCEPTION,
'message' => 'The following keys extend or overwrite the core snippets which is not allowed: id1, id2, id3',
];