/**
* Tests creating a filter instance with a custom prefix.
*/
public function testCustomFilterPrefix()
{
$filterName = 'Filter';
$filterPrefix = '\\SomePrefix\\Some\\';
// Ensure that there is no such class loaded
if (class_exists($filterName, false)) {
$this->markTestSkipped(sprintf('Class %s exists', $filterName));
}
try {
$this->factory->getFilterByName($filterName);
$this->fail(sprintf('Expected exception %s.', \Jyxo\Input\Exception::class));
} catch (\PHPUnit_Framework_ExpectationFailedException $e) {
throw $e;
} catch (\Exception $e) {
$this->assertInstanceOf(\Jyxo\Input\Exception::class, $e);
}
$this->factory->addFilterPrefix($filterPrefix);
$filter = $this->factory->getFilterByName($filterName);
}