getMock('CakeTestSuite', array('addTestFile')); $suite ->expects($this->exactly($count)) ->method('addTestFile'); $suite->addTestDirectory($testFolder); } /** * testAddTestDirectoryRecursive * * @return void */ public function testAddTestDirectoryRecursive() { $testFolder = CORE_TEST_CASES . DS . 'Cache'; $count = count(glob($testFolder . DS . '*Test.php')); $count += count(glob($testFolder . DS . 'Engine' . DS . '*Test.php')); $suite = $this->getMock('CakeTestSuite', array('addTestFile')); $suite ->expects($this->exactly($count)) ->method('addTestFile'); $suite->addTestDirectoryRecursive($testFolder); } /** * testAddTestDirectoryRecursiveWithHidden * * @return void */ public function testAddTestDirectoryRecursiveWithHidden() { $this->skipIf(!is_writeable(TMP), 'Cant addTestDirectoryRecursiveWithHidden unless the tmp folder is writable.'); $Folder = new Folder(TMP . 'MyTestFolder', true, 0777); mkdir($Folder->path . DS . '.svn', 0777, true); touch($Folder->path . DS . '.svn' . DS . 'InHiddenFolderTest.php'); touch($Folder->path . DS . 'NotHiddenTest.php'); touch($Folder->path . DS . '.HiddenTest.php'); $suite = $this->getMock('CakeTestSuite', array('addTestFile')); $suite ->expects($this->exactly(1)) ->method('addTestFile'); $suite->addTestDirectoryRecursive($Folder->pwd()); $Folder->delete(); } }