phpOMS/tests/Utils/Barcode/C128AbstractTest.php
2020-12-03 23:07:33 +01:00

74 lines
1.6 KiB
PHP

<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package tests
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace phpOMS\tests\Utils\Barcode;
use phpOMS\Utils\Barcode\C128Abstract;
/**
* @internal
*/
class C128AbstractTest extends \PHPUnit\Framework\TestCase
{
protected $obj = null;
protected function setUp() : void
{
$this->obj = new class() extends C128Abstract {};
}
/**
* @covers phpOMS\Utils\Barcode\C128Abstract<extended>
* @group framework
*/
public function testSetGet() : void
{
$this->obj->setContent('abc');
self::assertEquals('abc', $this->obj->getContent());
}
/**
* @covers phpOMS\Utils\Barcode\C128Abstract<extended>
* @group framework
*/
public function testInvalidDimensionWidth() : void
{
$this->expectException(\OutOfBoundsException::class);
$this->obj->setDimension(-2, 1);
}
/**
* @covers phpOMS\Utils\Barcode\C128Abstract<extended>
* @group framework
*/
public function testInvalidDimensionHeight() : void
{
$this->expectException(\OutOfBoundsException::class);
$this->obj->setDimension(1, -2);
}
/**
* @covers phpOMS\Utils\Barcode\C128Abstract<extended>
* @group framework
*/
public function testInvalidOrientation() : void
{
$this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
$this->obj->setOrientation(99);
}
}