← Back to team overview

mahara-contributors team mailing list archive

[Bug 1904349] A change has been merged

 

Reviewed:  https://reviews.mahara.org/11446
Committed: https://git.mahara.org/mahara/mahara/commit/a7ddfb0f050d0fcf46c7d48bc468252fbd160090
Submitter: Lisa Seeto (lisaseeto@xxxxxxxxxxxxxxx)
Branch:    master

commit a7ddfb0f050d0fcf46c7d48bc468252fbd160090
Author: Robert Lyon <robertl@xxxxxxxxxxxxxxx>
Date:   Mon Nov 16 09:22:20 2020 +1300

Bug 1904349: count error on trying to clear non-existant directory

When using behat testing with @tags there can be an error where
clearing non-existing directories in dataroot cause a count() on false
error

Change-Id: I30f95249c1bf86e52e7c0f92cf7f04a30dff5f4e
Signed-off-by: Robert Lyon <robertl@xxxxxxxxxxxxxxx>

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1904349

Title:
  Count() error when testing behat in some circumstances

Status in Mahara:
  Fix Committed

Bug description:
  When testing an old branch patch then moving to test a new branch
  patch there can be an error when clearing session directories

  The reason for this is older mahara expected less directories in
  session so when the newer one tries to clear the directories that
  don't exist we get the errors.

  [WAR] 64 (testing/classes/util.php:553) scandir(): (errno 2): No such file or directory
  Call stack (most recent first):
    * log_message("scandir(): (errno 2): No such file or directory", 8, true, true, "/home/robertl/code/mahara-devel/mahara/htdocs/test...", 553) at /home/robertl/code/mahara-devel/mahara/htdocs/lib/errors.php:515
    * error(2, "scandir(): (errno 2): No such file or directory", "/home/robertl/code/mahara-devel/mahara/htdocs/test...", 553, array(size 7)) at Unknown:0
    * scandir("/home/robertl/dataroot/develbehat/sessions/8/0/p") at /home/robertl/code/mahara-devel/mahara/htdocs/testing/classes/util.php:553
    * TestingUtil::clear_sessions() at /home/robertl/code/mahara-devel/mahara/htdocs/testing/classes/util.php:578
    * TestingUtil::reset_dataroot() at /home/robertl/code/mahara-devel/mahara/htdocs/testing/frameworks/behat/classes/util.php:119
    * BehatTestingUtil::install_site() at /home/robertl/code/mahara-devel/mahara/htdocs/testing/frameworks/behat/cli/util.php:177

  [WAR] 64 (testing/classes/util.php:554) count(): Parameter must be an array or an object that implements Countable
  Call stack (most recent first):
    * log_message("count(): Parameter must be an array or an object t...", 8, true, true, "/home/robertl/code/mahara-devel/mahara/htdocs/test...", 554) at /home/robertl/code/mahara-devel/mahara/htdocs/lib/errors.php:515
    * error(2, "count(): Parameter must be an array or an object t...", "/home/robertl/code/mahara-devel/mahara/htdocs/test...", 554, array(size 7)) at /home/robertl/code/mahara-devel/mahara/htdocs/testing/classes/util.php:554
    * TestingUtil::clear_sessions() at /home/robertl/code/mahara-devel/mahara/htdocs/testing/classes/util.php:578
    * TestingUtil::reset_dataroot() at /home/robertl/code/mahara-devel/mahara/htdocs/testing/frameworks/behat/classes/util.php:119
    * BehatTestingUtil::install_site() at /home/robertl/code/mahara-devel/mahara/htdocs/testing/frameworks/behat/cli/util.php:177

  
  To fix we will check for things better

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1904349/+subscriptions


References