function AggregatorTestBase::getEmptyOpml

Create a valid but empty OPML file.

Return value

Path to empty OPML file.

2 calls to AggregatorTestBase::getEmptyOpml()
ImportOpmlTest::submitImportForm in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/ImportOpmlTest.php
Submit form with invalid, empty and valid OPML files.
ImportOpmlTest::validateImportFormFields in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/ImportOpmlTest.php
Submit form filled with invalid fields.

File

drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php, line 269
Definition of Drupal\aggregator\Tests\AggregatorTestBase.

Class

AggregatorTestBase
Defines a base class for testing aggregator.module.

Namespace

Drupal\aggregator\Tests

Code

function getEmptyOpml() {
  $opml = <<<EOF
<?xml version="1.0" encoding="utf-8"?>
<opml version="1.0">
  <head></head>
  <body>
    <outline text="Sample text" />
    <outline text="Sample text" url="Sample URL" />
  </body>
</opml>
EOF;
  $path = 'public://empty-opml.xml';
  return file_unmanaged_save_data($opml, $path);
}