* @copyright Meritoo.pl */ class MissingSurveySummaryExceptionTest extends BaseTestCase { public function testConstructorVisibilityAndArguments() { static::assertConstructorVisibilityAndArguments(MissingSurveySummaryException::class, OopVisibilityType::IS_PUBLIC, 1, 1); } /** * @param int $surveyId ID of survey * @param string $expectedMessage Expected exception's message * * @dataProvider provideSurveyId */ public function testConstructorMessage($surveyId, $expectedMessage) { $exception = new MissingSurveySummaryException($surveyId); static::assertEquals($expectedMessage, $exception->getMessage()); } /** * Provides ID of survey * * @return Generator */ public function provideSurveyId() { $template = 'Summary of survey with ID %d is missing. Does the survey exist?'; yield[ 1, sprintf($template, 1), ]; yield[ '123', sprintf($template, '123'), ]; } }