Skip to content

Commit

Permalink
Fix DatabaseTableColumnNameTask
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Oct 31, 2020
1 parent 3107461 commit a00317c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/Generator/Task/DatabaseTableColumnTypeTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
class DatabaseTableColumnTypeTask implements TaskInterface {

public const SET_TABLE_TYPES = 'tableTypes';
public const SET_COLUMN_TYPES = 'columnTypes';

/**
* @var string[]
Expand Down Expand Up @@ -66,7 +66,7 @@ public function collect(): array {
ksort($list);

$result = [];
$registerArgumentsSet = new RegisterArgumentsSet(static::SET_TABLE_TYPES, $list);
$registerArgumentsSet = new RegisterArgumentsSet(static::SET_COLUMN_TYPES, $list);
$result[$registerArgumentsSet->key()] = $registerArgumentsSet;

foreach ($this->aliases as $alias) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function testCollect() {

/** @var \IdeHelper\Generator\Directive\RegisterArgumentsSet $directive */
$directive = array_shift($result);
$this->assertSame(DatabaseTableColumnTypeTask::SET_TABLE_TYPES, $directive->toArray()['set']);
$this->assertSame(DatabaseTableColumnTypeTask::SET_COLUMN_TYPES, $directive->toArray()['set']);

$list = $directive->toArray()['list'];
$list = array_map(function ($className) {
Expand Down Expand Up @@ -92,7 +92,7 @@ public function testCollect() {
}, $list);

$expectedList = [
'argumentsSet(\'tableTypes\')',
'argumentsSet(\'columnTypes\')',
];
$this->assertSame($expectedList, $list);
}
Expand All @@ -118,7 +118,7 @@ public function testCollectPluginLoaded() {

/** @var \IdeHelper\Generator\Directive\RegisterArgumentsSet $directive */
$directive = array_shift($result);
$this->assertSame(DatabaseTableColumnTypeTask::SET_TABLE_TYPES, $directive->toArray()['set']);
$this->assertSame(DatabaseTableColumnTypeTask::SET_COLUMN_TYPES, $directive->toArray()['set']);

$list = $directive->toArray()['list'];
$list = array_map(function ($className) {
Expand All @@ -143,7 +143,7 @@ public function testCollectPluginLoaded() {
}, $list);

$expectedList = [
'argumentsSet(\'tableTypes\')',
'argumentsSet(\'columnTypes\')',
];
$this->assertSame($expectedList, $list);

Expand Down
28 changes: 14 additions & 14 deletions tests/test_files/meta/phpstorm/.meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@
expectedArguments(
\Migrations\Table::addColumn(),
1,
argumentsSet('tableTypes')
argumentsSet('columnTypes')
);

expectedArguments(
Expand All @@ -610,7 +610,7 @@
expectedArguments(
\Migrations\Table::changeColumn(),
1,
argumentsSet('tableTypes')
argumentsSet('columnTypes')
);

expectedArguments(
Expand Down Expand Up @@ -677,18 +677,7 @@
);

registerArgumentsSet(
'routePaths',
'Awesome.Admin/AwesomeHouses::openDoor',
'Bar::index'
);

registerArgumentsSet(
'tableNames',
'wheels'
);

registerArgumentsSet(
'tableTypes',
'columnTypes',
'biginteger',
'binary',
'binaryuuid',
Expand All @@ -712,6 +701,17 @@
'year'
);

registerArgumentsSet(
'routePaths',
'Awesome.Admin/AwesomeHouses::openDoor',
'Bar::index'
);

registerArgumentsSet(
'tableNames',
'wheels'
);

registerArgumentsSet(
'validationWhen',
'create',
Expand Down

0 comments on commit a00317c

Please sign in to comment.