You've already forked gitea-composer-upload-action
creating configuration and type casting
This commit is contained in:
44
tests/Casting/MapperTypeTest.php
Normal file
44
tests/Casting/MapperTypeTest.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Casting;
|
||||
|
||||
use App\Casting\Type\IntegerType;
|
||||
use App\Casting\Type\StringType;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
#[CoversClass(MapperType::class)]
|
||||
final class MapperTypeTest extends TestCase
|
||||
{
|
||||
public function testGetStringType(): void
|
||||
{
|
||||
$type = (new MapperType(MapperType::STRING))->create('value');
|
||||
|
||||
self::assertInstanceOf(
|
||||
$type,
|
||||
StringType::class,
|
||||
);
|
||||
}
|
||||
|
||||
public function testGetIntegerType(): void
|
||||
{
|
||||
$type = (new MapperType(MapperType::INTEGER))->create(1);
|
||||
|
||||
self::assertInstanceOf(
|
||||
$type,
|
||||
IntegerType::class,
|
||||
);
|
||||
}
|
||||
|
||||
public function testGetIntType(): void
|
||||
{
|
||||
$type = (new MapperType(MapperType::INT))->create(1);
|
||||
|
||||
self::assertInstanceOf(
|
||||
$type,
|
||||
IntegerType::class,
|
||||
);
|
||||
}
|
||||
}
|
||||
23
tests/Configuration/ConfigurationTest.php
Normal file
23
tests/Configuration/ConfigurationTest.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Configuration;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
#[CoversClass(Configuration::class)]
|
||||
final class ConfigurationTest extends TestCase
|
||||
{
|
||||
public function testUseConfiguration(): void
|
||||
{
|
||||
$configuration = new Configuration();
|
||||
$configuration->set('test-option', 'test-value');
|
||||
|
||||
self::assertEquals(
|
||||
$configuration->get('test-option'),
|
||||
'test-value',
|
||||
);
|
||||
}
|
||||
}
|
||||
1
tests/benchmark.php
Normal file
1
tests/benchmark.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php
|
||||
Reference in New Issue
Block a user