/** * @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)); }
function move_uploaded_file($filename, $destination, $context_options = null) { return SplOverride::move_uploaded_file($filename, $destination, $context_options); }
public function testMoveUploadedFileNotUploaded() { // Should fail since is_uploaded_file(__FILE__) will result in false. $this->assertFalse(SplOverride::move_uploaded_file(__FILE__, '/dev/null')); }