mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 01:55:21 +02:00
refactor(BridgeFactory): make methods only accept valid class names (#2897)
This moves the responsibility for getting a valid class name to the users of BridgeFactory, avoiding the repeated sanitation. Improper use can also be checked statically.
This commit is contained in:
parent
20bf2aa4fe
commit
dbf8c5b7ae
9 changed files with 102 additions and 71 deletions
|
@ -40,7 +40,7 @@ class ActionImplementationTest extends TestCase
|
|||
|
||||
$this->setAction($path);
|
||||
|
||||
$methods = get_class_methods($this->obj);
|
||||
$methods = array_diff(get_class_methods($this->obj), ['__construct']);
|
||||
sort($methods);
|
||||
|
||||
$this->assertEquals($allowedMethods, $methods);
|
||||
|
|
|
@ -49,7 +49,7 @@ class ListActionTest extends TestCase
|
|||
$bridgeFactory = new BridgeFactory();
|
||||
|
||||
$this->assertEquals(
|
||||
count($bridgeFactory->getBridgeNames()),
|
||||
count($bridgeFactory->getBridgeClassNames()),
|
||||
count($items['bridges']),
|
||||
'Number of bridges doesn\'t match'
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue