/**
  * @dataProvider tempnamProvider
  */
 public function testTempnam($dir, $prefix, $expected_path_prefix)
 {
     $filename = SplOverride::tempnam($dir, $prefix);
     $this->assertTrue(StringUtil::startsWith($filename, $expected_path_prefix));
     $this->assertTrue(strlen($filename) > strlen($expected_path_prefix));
     $this->assertTrue(file_exists($filename));
     $this->assertEquals(0600, fileperms($filename) & 0xfff);
     $this->assertEquals(0, filesize($filename));
 }
示例#2
0
 function move_uploaded_file($filename, $destination, $context_options = null)
 {
     return SplOverride::move_uploaded_file($filename, $destination, $context_options);
 }
示例#3
0
 public function testMoveUploadedFileNotUploaded()
 {
     // Should fail since is_uploaded_file(__FILE__) will result in false.
     $this->assertFalse(SplOverride::move_uploaded_file(__FILE__, '/dev/null'));
 }