Skip to content

Commit

Permalink
revert laravel assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
pvsaintpe committed Aug 23, 2019
1 parent 37e7e3c commit dcfcaf4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/Helpers/ColumnAssertions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Umbrellio\Postgres\Helpers;

use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use PHPUnit\Framework\TestCase;

/**
Expand Down Expand Up @@ -34,7 +35,12 @@ protected function assertDefaultOnColumn(string $table, string $column, ?string
$this->assertSame($expected, $defaultValue);
}

protected function assertTypeColumn(string $table, string $column, string $expected): void
protected function assertLaravelTypeColumn(string $table, string $column, string $expected): void
{
$this->assertSame($expected, Schema::getColumnType($table, $column));
}

protected function assertPostgresTypeColumn(string $table, string $column, string $expected): void
{
$this->assertSame($expected, $this->getTypeListing($table, $column));
}
Expand Down
5 changes: 3 additions & 2 deletions tests/Functional/Schema/CreateTableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ public function columnAssertions(): void

$this->assertSameTable(['id', 'name', 'field_comment', 'field_default'], 'test_table');

$this->assertTypeColumn('test_table', 'id', 'integer');
$this->assertTypeColumn('test_table', 'name', 'character varying');
$this->assertPostgresTypeColumn('test_table', 'id', 'integer');
$this->assertLaravelTypeColumn('test_table', 'name', 'string');
$this->assertPostgresTypeColumn('test_table', 'name', 'character varying');

$this->assertDefaultOnColumn('test_table', 'field_default', '123');
$this->assertCommentOnColumn('test_table', 'field_comment', 'test');
Expand Down

0 comments on commit dcfcaf4

Please sign in to comment.