Example #1
0
 function testOpeningAndGettingContents()
 {
     $testString = 'Different operating system families have different line-ending conventions. When you write a text file and want to insert a line break, you need to use the correct line-ending character(s) for your operating system.';
     $testFileName = $this->getTempFileName('GAAnotherFileToTest.txt');
     file_put_contents($testFileName, $testString);
     $this->assertFileExists($testFileName, 'Unable to create test file');
     $file = new File($testFileName);
     $this->assertEquals($testString, $file->getContent());
     $this->assertEquals($testString, $file->getContents());
     $this->assertEquals($testString, $file->read());
 }