Logo \n\n https://localhost/storage/email-images/logo.png HTML; $ref = new ReflectionClass($controller); $method = $ref->getMethod('repairImgWithoutSrc'); $method->setAccessible(true); /** @var string $output */ $output = $method->invoke($controller, $input); expect($output)->toContain('src="https://localhost/storage/email-images/logo.png"'); });