rss-bridge/tests/BridgeFactoryTest.php
Dag 0a8fe57003
feat: enable bridges using env var (#3428)
* refactor: bridgefactory, add tests

* refactor: move defaultly enabled bridges to config

* refactor

* refactor

* feat: add support for enabling bridges with env var
2023-06-11 03:16:03 +02:00

30 lines
999 B
PHP

<?php
namespace RssBridge\Tests;
use PHPUnit\Framework\TestCase;
class BridgeFactoryTest extends TestCase
{
public function setUp(): void
{
\Configuration::loadConfiguration();
}
public function testNormalizeBridgeName()
{
$this->assertSame('TwitterBridge', \BridgeFactory::normalizeBridgeName('TwitterBridge'));
$this->assertSame('TwitterBridge', \BridgeFactory::normalizeBridgeName('TwitterBridge.php'));
$this->assertSame('TwitterBridge', \BridgeFactory::normalizeBridgeName('Twitter'));
}
public function testSanitizeBridgeName()
{
$sut = new \BridgeFactory();
$this->assertSame('TwitterBridge', $sut->createBridgeClassName('twitterbridge'));
$this->assertSame('TwitterBridge', $sut->createBridgeClassName('twitter'));
$this->assertSame('TwitterBridge', $sut->createBridgeClassName('tWitTer'));
$this->assertSame('TwitterBridge', $sut->createBridgeClassName('TWITTERBRIDGE'));
}
}