Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-51863

/lib/filestorage/tests/zip_packer_test.php fails on newer phps

    XMLWordPrintable

Details

    Description

      Fails in php 5.6.14. Seems to be related to php bug fixed #70322 - ZipArchive::close() doesn't indicate errors.

      In the test we are doing bad stuff and looking for errors output.

      PHPUnit test environment setup complete.
      PHPUnit ready!
      Moodle 3.0dev+ (Build: 20151020), pgsql, de2a3b742333298d535665507934ef7410e70879
      PHPUnit 4.8.10 by Sebastian Bergmann and contributors.
       
      ..Debugging: Can not zip 'xtest.txt' file
      * line 126 of /lib/filestorage/zip_packer.php: call to debugging()
      * line 165 of /lib/filestorage/tests/zip_packer_test.php: call to zip_packer->archive_to_pathname()
      * line ? of unknownfile: call to core_files_zip_packer_testcase->test_archive_to_pathname()
      * line 886 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to ReflectionMethod->invokeArgs()
      * line 746 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit_Framework_TestCase->runTest()
      * line 80 of /lib/phpunit/classes/advanced_testcase.php: call to PHPUnit_Framework_TestCase->runBare()
      * line 601 of /vendor/phpunit/phpunit/src/Framework/TestResult.php: call to advanced_testcase->runBare()
      * line 702 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit_Framework_TestResult->run()
      * line 735 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit_Framework_TestCase->run()
      * line 432 of /vendor/phpunit/phpunit/src/TextUI/TestRunner.php: call to PHPUnit_Framework_TestSuite->run()
      * line 148 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit_TextUI_TestRunner->doRun()
      * line 100 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit_TextUI_Command->run()
      * line 47 of /vendor/phpunit/phpunit/phpunit: call to PHPUnit_TextUI_Command::main()
      ESSSSSS
       
      Time: 3.17 seconds, Memory: 50.75Mb
       
      There was 1 error:
       
      1) core_files_zip_packer_testcase::test_archive_to_pathname
      ZipArchive::close(): Can't remove file: No such file or directory
       
      /Users/danp/moodles/im/moodle/lib/filestorage/zip_archive.php:205
      /Users/danp/moodles/im/moodle/lib/filestorage/zip_packer.php:154
      /Users/danp/moodles/im/moodle/lib/filestorage/tests/zip_packer_test.php:165
      /Users/danp/moodles/im/moodle/lib/phpunit/classes/advanced_testcase.php:80
       
      To re-run:
       vendor/bin/phpunit core_files_zip_packer_testcase lib/filestorage/tests/zip_packer_test.php
       
      FAILURES!
      Tests: 4, Assertions: 173, Errors: 1, Skipped: 6.
      

      Attachments

        Issue Links

          Activity

            People

              stronk7 Eloy Lafuente (stronk7)
              poltawski Dan Poltawski
              Rajesh Taneja Rajesh Taneja
              Dan Poltawski Dan Poltawski
              Dan Poltawski Dan Poltawski
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona), Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Nov/15