-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into upgrade-php
- Loading branch information
Showing
10 changed files
with
110 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Umbrellio\Postgres\Schema\Types; | ||
|
||
use Doctrine\DBAL\Platforms\AbstractPlatform; | ||
use Doctrine\DBAL\Types\Type; | ||
|
||
class TsTzRangeType extends Type | ||
{ | ||
public const TYPE_NAME = 'tstzrange'; | ||
|
||
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string | ||
{ | ||
return static::TYPE_NAME; | ||
} | ||
|
||
public function getName(): string | ||
{ | ||
return self::TYPE_NAME; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Umbrellio\Postgres\Unit\Schema\Types; | ||
|
||
use Doctrine\DBAL\Platforms\AbstractPlatform; | ||
use Umbrellio\Postgres\Schema\Types\TsTzRangeType; | ||
use Umbrellio\Postgres\Tests\TestCase; | ||
|
||
class TsTzRangeTypeTest extends TestCase | ||
{ | ||
/** | ||
* @var AbstractPlatform | ||
*/ | ||
private $abstractPlatform; | ||
|
||
/** | ||
* @var TsRangeType | ||
*/ | ||
private $type; | ||
|
||
protected function setUp(): void | ||
{ | ||
parent::setUp(); | ||
|
||
$this->type = $this | ||
->getMockBuilder(TsTzRangeType::class) | ||
->disableOriginalConstructor() | ||
->getMockForAbstractClass(); | ||
$this->abstractPlatform = $this->getMockForAbstractClass(AbstractPlatform::class); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function getSQLDeclaration(): void | ||
{ | ||
$this->assertSame(TsTzRangeType::TYPE_NAME, $this->type->getSQLDeclaration([], $this->abstractPlatform)); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function getTypeName(): void | ||
{ | ||
$this->assertSame(TsTzRangeType::TYPE_NAME, $this->type->getName()); | ||
} | ||
} |