function file_exists($filename) { if (File::getFileExists() !== null) { return File::getFileExists(); } return \file_exists($filename); }
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(); }
public function test_getFileSize_ShouldReturnNull_IfFileDoesNotExists() { File::setFileExists(false); $size = Filesystem::getFileSize(__FILE__); $this->assertNull($size); }
public function test_isAbormal_ShouldReturnTrue_IfFilesizeIsTooBig() { File::setFileSize(1024 * 1024 * 101); File::setFileExists(true); $this->assertTrue($this->output->isAbnormal()); }
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()); }