fossar / selfoss

multipurpose rss reader, live stream, mashup, aggregation web application
https://selfoss.aditu.de
GNU General Public License v3.0
2.35k stars 344 forks source link

Spout Test Interface #309

Open theomega opened 11 years ago

theomega commented 11 years ago

I'm missing a simple way of testing Spouts. I always have to run update.php, check the output and modify my php-files in a loop. Especially the caching of the results makes testing nearly impossible.

I think a simple page, where I can provide the spout-class as parameter would be nice. It should not save anything to the database but instead only show the output which would be saved. Even better would be the possibility to run the php-files containing the sprouts.

If such an interface existed, I would have written multiple sprouts I think.

aminecmi commented 9 years ago

That would be really great.

jtojnar commented 1 year ago

For testing during spout development, I usually just run workbench.php file in my selfoss directory. It contains something like the following (for selfoss 2.19):

<?php

require __DIR__ . '/src/common.php';

use Monolog\Handler\StreamHandler;

$log->popHandler();
$handler = new StreamHandler('php://stderr');
$log->pushHandler($handler);

$spout = $dice->create(spouts\rss\feed::class);

$params = [
    'url' => 'https://web.developpez.com/index/rss',
];
$spout->load($params);

foreach ($spout->getItems() as $item) {
    $content = $item->getContent();
    var_dump($content);
    die;
}