function AggregatorTestBase::getInvalidOpml

Creates an invalid OPML file.

Return value

Path to invalid OPML file.

1 call to AggregatorTestBase::getInvalidOpml()
ImportOpmlTest::submitImportForm in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/ImportOpmlTest.php
Submits form with invalid, empty, and valid OPML files.

File

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

Class

AggregatorTestBase
Defines a base class for testing the Aggregator module.

Namespace

Drupal\aggregator\Tests

Code

function getInvalidOpml() {
  $opml = <<<EOF
<opml>
  <invalid>
</opml>
EOF;
  $path = 'public://invalid-opml.xml';
  return file_unmanaged_save_data($opml, $path);
}