示例#1
0
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
 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());
 }