Hi @Nakov, thanks for your reply.
As said, accessing the application via the browser yields the correct results. The config is fine:
'HTML.Allowed' => 'a[href|target|title|rel],b,big,blockquote,br,code,del,div,em,h1,h2,h3,h4,h5,h6,hr,i,img[style|width|height|alt|src],li,ol,p[style],pre,small,span[style],strong,sub,sup,table[style|summary],td[abbr],th[abbr],tr,ul,*[style]',
This is the PurifySetupProvider:
<?php
namespace App\Providers;
use HTMLPurifier_HTMLDefinition;
use Stevebauman\Purify\Facades\Purify;
use Illuminate\Support\ServiceProvider;
class PurifySetupProvider extends ServiceProvider
{
const DEFINITION_ID = 'tinymce-editor';
const DEFINITION_REV = 1;
/**
* Register services.
*
* @return void
*/
public function register()
{
/** @var \HTMLPurifier $purifier */
$purifier = Purify::getPurifier();
/** @var \HTMLPurifier_Config $config */
$config = $purifier->config;
$config->set('HTML.DefinitionID', static::DEFINITION_ID);
$config->set('HTML.DefinitionRev', static::DEFINITION_REV);
if ($def = $config->maybeGetRawHTMLDefinition()) {
$this->setupDefinitions($def);
}
$purifier->config = $config;
}
protected function setupDefinitions(HTMLPurifier_HTMLDefinition $def)
{
$def->addAttribute('a', 'target', 'Text');
}
}
Which is then loaded in config/app.php
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
App\Providers\PurifySetupProvider::class,
],
As said, it works fine using the browser, just not in the tests. Is there any caching going on maybe? For testing? Is there a PHPUnit cache I need to clear?