From bfcb3cfcd0a567b2d1d211d8d6e6448a8779e047 Mon Sep 17 00:00:00 2001 From: Eric Stern Date: Thu, 19 Sep 2013 15:14:44 -0700 Subject: [PATCH] Perform case-insensitive check for PHPUnit test finder to not return original file Summary: PhpunitTestEngine incorrectly included some source files as tests when run on a case-insensive fiesystem. This fixes that behavior. It could introduce problems for case-sensive users, but it's extremely unlikely to be an issue in practice (who would put a file in both Tests/ and tests/ and expect different results for the two?) Test Plan: arc unit before and after change on OS X. Stubs and autoloaders in .../tests/... directories are no longer picked up. Reviewers: epriestley Reviewed By: epriestley CC: aurelijus, Korvin, aran Differential Revision: https://secure.phabricator.com/D7048 --- src/unit/engine/PhpunitTestEngine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unit/engine/PhpunitTestEngine.php b/src/unit/engine/PhpunitTestEngine.php index d207d82f..02e284fd 100644 --- a/src/unit/engine/PhpunitTestEngine.php +++ b/src/unit/engine/PhpunitTestEngine.php @@ -148,7 +148,7 @@ final class PhpunitTestEngine extends ArcanistBaseUnitTestEngine { // Don't look above the project root. continue; } - if (Filesystem::resolvePath($full_path) == $path) { + if (0 == strcasecmp(Filesystem::resolvePath($full_path), $path)) { // Don't return the original file. continue; } -- 2.43.0