public function AggregatorTestBase::getEmptyOpml in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/aggregator/src/Tests/AggregatorTestBase.php \Drupal\aggregator\Tests\AggregatorTestBase::getEmptyOpml()
Creates a valid but empty OPML file.
Return value
string Path to empty OPML file.
2 calls to AggregatorTestBase::getEmptyOpml()
- ImportOpmlTest::submitImportForm in core/
modules/ aggregator/ src/ Tests/ ImportOpmlTest.php - Submits form with invalid, empty, and valid OPML files.
- ImportOpmlTest::validateImportFormFields in core/
modules/ aggregator/ src/ Tests/ ImportOpmlTest.php - Submits form filled with invalid fields.
File
- core/
modules/ aggregator/ src/ Tests/ AggregatorTestBase.php, line 301 - Contains \Drupal\aggregator\Tests\AggregatorTestBase.
Class
- AggregatorTestBase
- Defines a base class for testing the Aggregator module.
Namespace
Drupal\aggregator\TestsCode
public 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);
}