mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-26 03:16:33 +03:00
31 lines
999 B
PHP
31 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'));
|
||
|
}
|
||
|
}
|