コード例 #1
0
ファイル: File.php プロジェクト: FluentDevelopment/piwik
function file_exists($filename)
{
    if (File::getFileExists() !== null) {
        return File::getFileExists();
    }
    return \file_exists($filename);
}
コード例 #2
0
 public function tearDown()
 {
     File::reset();
     // make sure the global container exists for the next test case that is executed (since logging can be done
     // before a test sets up an environment)
     $nextTestEnviornment = new Environment($environment = null, array(), $postBootstrappedEvent = false);
     $nextTestEnviornment->init();
     parent::tearDown();
 }
コード例 #3
0
ファイル: FilesystemTest.php プロジェクト: dorelljames/piwik
 public function test_getFileSize_ShouldReturnNull_IfFileDoesNotExists()
 {
     File::setFileExists(false);
     $size = Filesystem::getFileSize(__FILE__);
     $this->assertNull($size);
 }
コード例 #4
0
 public function test_isAbormal_ShouldReturnTrue_IfFilesizeIsTooBig()
 {
     File::setFileSize(1024 * 1024 * 101);
     File::setFileExists(true);
     $this->assertTrue($this->output->isAbnormal());
 }
コード例 #5
0
 public function test_isRunning_ShouldMarkProcessAsFinished_IfPidFileIsTooBig()
 {
     if (!Process::isSupported()) {
         $this->markTestSkipped('Not supported');
     }
     $this->process->startProcess();
     $this->assertTrue($this->process->isRunning());
     $this->assertFalse($this->process->hasFinished());
     File::setFileSize(505);
     $this->assertFalse($this->process->isRunning());
     $this->assertTrue($this->process->hasFinished());
 }