Add tests for CakeTestSuite and dont include hidden folders when recursively addTestFile #371

Merged
merged 2 commits into from Dec 10, 2011

Conversation

Projects
None yet
2 participants
@shama
Contributor

shama commented Dec 10, 2011

Adding tests for CakeTestSuite.

Also when trying to build a test suite while using svn it crashes when using addTestDirectoryRecursive(). Because it also adds the duplicated *Test.php files in the .svn folders.

The real issue is likely with Folder::tree() as even when you set it to skip hidden files it still will include visible files in hidden folders (as pull #370 demonstrates). I imagine that is not the desired behavior but 'fixing' that could likely cause more issues for others then just doing this simple fix in CakeTestSuite.

lib/Cake/TestSuite/CakeTestSuite.php
@@ -52,6 +52,9 @@ public function addTestDirectoryRecursive($directory = '.') {
$files = $Folder->tree(null, false, 'files');
foreach ($files as $file) {
+ if (strpos($file, DS.'.') !== false) {

This comment has been minimized.

@lorenzo

lorenzo Dec 10, 2011

Member

Just a minor change needed here, the standard is to have spaces both before and after the concatenation symbol "."

@lorenzo

lorenzo Dec 10, 2011

Member

Just a minor change needed here, the standard is to have spaces both before and after the concatenation symbol "."

This comment has been minimized.

@shama

shama Dec 10, 2011

Contributor

Thanks! Fixed. You think after all those code standards commits I would have caught this. :)

@shama

shama Dec 10, 2011

Contributor

Thanks! Fixed. You think after all those code standards commits I would have caught this. :)

This comment has been minimized.

@lorenzo

lorenzo Dec 10, 2011

Member

Indeed, I was surprised :P

@lorenzo

lorenzo Dec 10, 2011

Member

Indeed, I was surprised :P

lorenzo added a commit that referenced this pull request Dec 10, 2011

Merge pull request #371 from shama/patch-caketestsuite
Add tests for CakeTestSuite and dont include hidden folders when recursively addTestFile

@lorenzo lorenzo merged commit 47b2f3e into cakephp:2.0 Dec 10, 2011

@kicaj kicaj referenced this pull request Feb 17, 2016

Closed

DataSource in CakePHP 2.8.0 #8281

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment