/**
  * @depends testInsertFileContent
  */
 public function testWriteFile()
 {
     $record = new CustomerFile();
     $record->tag = 'new new';
     $record->status = 7;
     $newFileContent = 'Test new file content';
     $record->setAttribute('newFileContent', $newFileContent);
     $record->save();
     $outputFileName = $this->getTestFilePath() . DIRECTORY_SEPARATOR . 'out.txt';
     $this->assertTrue($record->writeFile($outputFileName));
     $this->assertEquals($newFileContent, file_get_contents($outputFileName));
     $record2 = CustomerFile::findOne($record->_id);
     $outputFileName = $this->getTestFilePath() . DIRECTORY_SEPARATOR . 'out_refreshed.txt';
     $this->assertTrue($record2->writeFile($outputFileName));
     $this->assertEquals($newFileContent, file_get_contents($outputFileName));
 }