public function testFileReadStatic() { $rc = _File::_writeToFile(_FILETEST_TEST_TEXT_1, _FILETEST_TMP_FILE_LOCATION, _FileConstants::READ_WRITE_TRUNCATE_CREATE); $this->assertTrue($rc); $readText = _File::_readAllFromFile(_FILETEST_TMP_FILE_LOCATION); echo $readText; $this->assertEquals(_FILETEST_TEST_TEXT_1, $readText); }
<?php include 'vendor/autoload.php'; use _\_File; $filename = "/tmp/" . date('Y-m-d-H-i-s'); _File::_writeToFile("This is a test", $filename); $text = _File::_readAllFromFile($filename); ?> <html> <body> <p>Text written to file: <?php echo $filename; ?> </p> <p><pre><?php echo $text; ?> </p> </body> </html>