Skip to content

Commit

Permalink
Added tests for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
pvsaintpe committed Jan 2, 2021
1 parent 69e00e5 commit b52a50b
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 0 deletions.
51 changes: 51 additions & 0 deletions tests/Unit/Schema/Types/NumericTypeTest.php
@@ -0,0 +1,51 @@
<?php

declare(strict_types=1);

namespace Umbrellio\Postgres\Unit\Schema\Types;

use Doctrine\DBAL\Platforms\AbstractPlatform;
use Umbrellio\Postgres\Schema\Types\NumericType;
use Umbrellio\Postgres\Tests\TestCase;

class NumericTypeTest extends TestCase
{
/**
* @var AbstractPlatform
*/
private $abstractPlatform;

/**
* @var NumericType
*/
private $type;

protected function setUp(): void
{
parent::setUp();

$this->type = $this
->getMockBuilder(NumericType::class)
->disableOriginalConstructor()
->getMockForAbstractClass();
$this->abstractPlatform = $this->getMockForAbstractClass(AbstractPlatform::class);
}


/**
* @test
*/
public function getSQLDeclaration(): void
{
$this->assertSame(NumericType::TYPE_NAME, $this->type->getSQLDeclaration([], $this->abstractPlatform));
}


/**
* @test
*/
public function getTypeName(): void
{
$this->assertSame(NumericType::TYPE_NAME, $this->type->getName());
}
}
51 changes: 51 additions & 0 deletions tests/Unit/Schema/Types/TsRangeTypeTest.php
@@ -0,0 +1,51 @@
<?php

declare(strict_types=1);

namespace Umbrellio\Postgres\Unit\Schema\Types;

use Doctrine\DBAL\Platforms\AbstractPlatform;
use Umbrellio\Postgres\Schema\Types\TsRangeType;
use Umbrellio\Postgres\Tests\TestCase;

class TsRangeTypeTest extends TestCase
{
/**
* @var AbstractPlatform
*/
private $abstractPlatform;

/**
* @var TsRangeType
*/
private $type;

protected function setUp(): void
{
parent::setUp();

$this->type = $this
->getMockBuilder(TsRangeType::class)
->disableOriginalConstructor()
->getMockForAbstractClass();
$this->abstractPlatform = $this->getMockForAbstractClass(AbstractPlatform::class);
}


/**
* @test
*/
public function getSQLDeclaration(): void
{
$this->assertSame(TsRangeType::TYPE_NAME, $this->type->getSQLDeclaration([], $this->abstractPlatform));
}


/**
* @test
*/
public function getTypeName(): void
{
$this->assertSame(TsRangeType::TYPE_NAME, $this->type->getName());
}
}

0 comments on commit b52a50b

Please sign in to comment.