assertFileExists($xmlForm); // File with content? $this->assertNotEmpty(file_get_contents($xmlForm)); // Delete the file unlink($xmlForm); // Create another empty touch($xmlForm); // The file exists, but is empty, should be regenerated Form::createXMLFileIfNotExists($xmlForm); // File with content? $this->assertNotEmpty(file_get_contents($xmlForm)); } }