* @copyright Meritoo.pl */ class UnknownInstanceOfResultItemTest extends BaseTestCase { public function testConstructorVisibilityAndArguments() { static::assertConstructorVisibilityAndArguments(UnknownInstanceOfResultItem::class, OopVisibilityType::IS_PUBLIC, 1, 1); } /** * @param string $method Name of called method while talking to the LimeSurvey's API. One of the * MethodType class constants. * @param string $expectedMessage Expected exception's message * * @dataProvider provideMethodName */ public function testConstructorMessage($method, $expectedMessage) { $exception = new UnknownInstanceOfResultItem($method); static::assertEquals($expectedMessage, $exception->getMessage()); } /** * Provides name of called method * * @return Generator */ public function provideMethodName() { $template = 'Class name used to create instance of one item used by result the of \'%s\' LimeSurvey API\'s' . ' method is unknown. Proper class is not mapped in %s::%s() method. Did you forget about this?'; yield[ MethodType::LIST_SURVEYS, sprintf($template, MethodType::LIST_SURVEYS, ResultProcessor::class, 'getItemClassName'), ]; yield[ MethodType::ADD_PARTICIPANTS, sprintf($template, MethodType::ADD_PARTICIPANTS, ResultProcessor::class, 'getItemClassName'), ]; } }