Bug Report #3675

Problem with Kohana_CoreTest::test_find_file_returns_false_or_array_on_failure

Added by Jeremy Bush over 3 years ago. Updated over 3 years ago.

Status:ClosedStart date:02/01/2011
Priority:NormalDue date:02/01/2011
Assignee:Jeremy Bush% Done:

100%

Category:Core
Target version:v3.1.2
Resolution:fixed Points:

Description

Kohana_CoreTest::test_find_file_returns_false_or_array_on_failure
<boolean:false> does not match expected type "array".

This test fails if caching is TRUE. Here are the tests that are run:

$this->assertFalse(Kohana::find_file('configy', 'zebra'));
$this->assertSame(array(), Kohana::find_file('configy', 'zebra', NULL, TRUE));

The first time that it is run, the result is cached so the second test fails because the FALSE boolean is returned instead of an array. The solution for this is to test different options each time config, zebra and then configy, giraffe for instance.

Additionally, the comment for this test should probably be updated as it does not appear to be correct in explaining the case for returning an array. It is only ever trying to find one file, not multiple. Current description reads:

If a file can't be found then find_file() should return FALSE if only a single file was requested, or an empty array if multiple files (i.e. configuration files) were requested.

Related issues

Follows Kohana v3.x - Bug Report #3674: Problem with Kohana_CoreTest::test_find_file_returns_fals... Closed 01/31/2011

History

#1 Updated by Matt Button over 3 years ago

This looks to be an exact duplicate of #3674?

#2 Updated by Jeremy Bush over 3 years ago

Yes, look at the version and related issues.

#3 Updated by Matt Button over 3 years ago

Ah I see, I forgot we were doing that

#4 Updated by Bob Eagan over 3 years ago

Before anyone fixes this, please be aware of the updated discussion that happened on #3674. This turned out to be a bug in find_file as opposed to one in the unit test. It should be corrected in core and not just fixing the unit test as originally proposed.

#5 Updated by Jeremy Bush over 3 years ago

It shouldn't be a problem. Fixes are done in lower versions and merged up. Since this issue follows the original, there shouldn't be an issue.

#6 Updated by Isaiah DeRose-Wilson over 3 years ago

  • Target version changed from v3.1.0 to v3.1.1

#7 Updated by Jeremy Bush over 3 years ago

  • Target version changed from v3.1.1 to v3.1.2

#8 Updated by Jeremy Bush over 3 years ago

  • Status changed from New to Closed
  • Assignee set to Jeremy Bush
  • % Done changed from 0 to 100
  • Resolution set to fixed

Also available in: Atom PDF