linkmobility-php-client/Tests/Url/UrlTest.php

96 lignes
2.0 KiB
PHP
Brut Vue normale Historique

2022-07-10 21:52:37 +02:00
<?php
/**
2022-07-13 10:50:45 +02:00
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* https://www.d3data.de
2022-07-10 21:52:37 +02:00
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
2022-07-13 10:50:45 +02:00
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
* @link https://www.oxidmodule.com
2022-07-10 21:52:37 +02:00
*/
2022-07-13 10:41:23 +02:00
declare(strict_types=1);
2022-07-10 21:52:37 +02:00
namespace D3\LinkmobilityClient\Tests\Url;
2022-07-10 21:52:37 +02:00
use D3\LinkmobilityClient\Tests\ApiTestCase;
use D3\LinkmobilityClient\Url\Url;
2022-07-10 21:52:37 +02:00
use ReflectionException;
class UrlTest extends ApiTestCase
{
/** @var Url */
2022-07-11 15:06:18 +02:00
public $url;
2022-07-10 21:52:37 +02:00
/**
* @return void
*/
2022-07-13 10:41:23 +02:00
public function setUp(): void
2022-07-10 21:52:37 +02:00
{
parent::setUp();
$this->url = new Url();
}
public function tearDown(): void
{
parent::tearDown();
unset($this->url);
}
/**
* @test
* @return void
* @throws ReflectionException
* @covers \D3\LinkmobilityClient\Url\Url::getBaseUri
2022-07-10 21:52:37 +02:00
*/
public function testGetBaseUri()
{
$fixture = "fixtureUri";
$this->setValue($this->url, 'baseUri', $fixture);
$this->assertSame(
$fixture,
$this->callMethod(
$this->url,
'getBaseUri'
)
);
}
/**
* @test
* @throws ReflectionException
* @covers \D3\LinkmobilityClient\Url\Url::getTextSmsUri
*/
public function testGetTextSmsUri()
{
$uri = $this->callMethod(
$this->url,
'getTextSmsUri'
);
$this->assertIsString($uri);
$this->assertStringStartsWith('/', $uri);
}
/**
* @test
* @throws ReflectionException
* @covers \D3\LinkmobilityClient\Url\Url::getBinarySmsUri
*/
public function testGetBinarySmsUri()
{
$uri = $this->callMethod(
$this->url,
'getBinarySmsUri'
);
$this->assertIsString($uri);
$this->assertStringStartsWith('/', $uri);
}
2022-07-10 21:52:37 +02:00
}