selfoss icon indicating copy to clipboard operation
selfoss copied to clipboard

Spout Test Interface

Open theomega opened this issue 12 years ago • 2 comments

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.

theomega avatar May 04 '13 10:05 theomega

That would be really great.

aminecmi avatar Jul 04 '15 19:07 aminecmi

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;
}

jtojnar avatar Oct 16 '22 01:10 jtojnar