original_string: public static function setup_real_writer_instance() {
          if (!PHPUNIT_TEST) {
              throw new coding_exception('setup_real_writer_instance() is only for use with PHPUnit tests.');
          }
  
          $instance = static::instance();
  
          if (null === $instance->realwriter) {
              $instance->realwriter = new moodle_content_writer(static::instance());
          }
      }
code: public static function setup_real_writer_instance() {
          if (!PHPUNIT_TEST) {
              throw new coding_exception('setup_real_writer_instance() is only for use with PHPUnit tests.');
          }
  
          $instance = static::instance();
  
          if (null === $instance->realwriter) {
              $instance->realwriter = new moodle_content_writer(static::instance());
          }
      }
code_tokens: public static function setup_real_writer_instance ( ) { if ( ! PHPUNIT_TEST ) { throw new coding_exception ( 'setup_real_writer_instance() is only for use with PHPUnit tests.' ) ; } $ instance = static :: instance ( ) ; if ( null === $ instance -> realwriter ) { $ instance -> realwriter = new moodle_content_writer ( static :: instance ( ) ) ; } }
docstring: Create a real content_writer for use by PHPUnit tests,
  where a mock writer will not suffice.
  
  @return  content_writer
docstring_tokens: Create a real content_writer for use by PHPUnit tests where a mock writer will not suffice .