コード例 #1
0
 /**
  * testAddTestDirectoryRecursiveWithNonPhp
  *
  * @return void
  */
 public function testAddTestDirectoryRecursiveWithNonPhp()
 {
     $this->skipIf(!is_writable(TMP), 'Cant addTestDirectoryRecursiveWithNonPhp unless the tmp folder is writable.');
     $Folder = new Folder(TMP . 'MyTestFolder', true, 0777);
     touch($Folder->path . DS . 'BackupTest.php~');
     touch($Folder->path . DS . 'SomeNotesTest.txt');
     touch($Folder->path . DS . 'NotHiddenTest.php');
     $suite = $this->getMock('Cake\\TestSuite\\TestSuite', array('addTestFile'));
     $suite->expects($this->exactly(1))->method('addTestFile');
     $suite->addTestDirectoryRecursive($Folder->pwd());
     $Folder->delete();
 }
コード例 #2
0
 /**
  * testDirSize method
  *
  * @return void
  */
 public function testDirSize()
 {
     $path = TMP . 'tests/';
     $Folder = new Folder($path . 'config_non_existent', true);
     $this->assertEquals(0, $Folder->dirSize());
     $File = new File($Folder->pwd() . DS . 'my.php', true, 0777);
     $File->create();
     $File->write('something here');
     $File->close();
     $this->assertEquals(14, $Folder->dirSize());
 }