Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-22991

Functional tests break for wrong path of tr files in DefinitionBased parser

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Medium Medium
    • None
    • 2014.03
    • Test framework
    • Ubuntu 13.04
      Apache 2.4
      PHP 5.5.3
      MySQL: 5.1.66

    Description

      After update to 2014.03 version, when functional tests are launched in my own project the path of tr files is wrong so I get the following error:

      file_get_contents(eZ/Publish/Core/Persistence/Tests/TransformationProcessor/_fixtures/transformations/ascii.tr): failed to open stream: No such file or directory
      .../vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/TransformationProcessor/DefinitionBased/Parser.php:92
      

      The error is thrown in parse() method:

          public function parse( $file )
          {
              return $this->parseString(
                  file_get_contents( $file )
              );
          }
      

      A fast solution should be to check if the file exists before to launch the parseString method. Something like that:

          public function parse( $file )
          {
              if( !is_file($file) )
              {
                  return array();
              }
      
              return $this->parseString(
                  file_get_contents( $file )
              );
          }
      

      Pull request is located at https://github.com/ezsystems/ezpublish-kernel/pull/888

      Attachments

        Activity

          People

            Unassigned Unassigned
            dymissy dymissy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: