Skip to content

Commit d50072c

Browse files
committed
Adding test coverage
1 parent fe450e1 commit d50072c

5 files changed

Lines changed: 874 additions & 1 deletion

File tree

src/Schema/Columns/Contracts/Column.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ abstract class Column implements Column_Interface, Indexable {
3535
'CURRENT_TIMESTAMP',
3636
'CURRENT_DATE',
3737
'CURRENT_TIME',
38+
'NULL',
3839
];
3940

4041
/**

src/Schema/Indexes/Contracts/Abstract_Index.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ abstract class Abstract_Index implements Index {
5151
*/
5252
protected string $type;
5353

54+
/**
55+
* Constructor.
56+
*
57+
* @param string $name The name of the index.
58+
*/
59+
public function __construct( string $name = '' ) {
60+
$this->name = $name;
61+
}
62+
5463
/**
5564
* Get the name of the index.
5665
*

src/Schema/Indexes/Fulltext_Index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
/**
1717
* Class Fulltext_Index
1818
*
19+
* Fulltext indexes are only supporting in MySQL 5.6+.
20+
*
21+
* They should be avoided for projects that are usable by the whole WP community for now.
22+
*
1923
* @since TBD
2024
*
2125
* @package StellarWP\Schema\Indexes

src/Schema/Tables/Table_Schema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ protected function validate_indexes(): void {
164164
}
165165
}
166166

167-
if ( array_values( $indexed_columns ) !== array_unique( array_values( $indexed_columns ) ) ) {
167+
if ( array_values( $indexed_columns ) !== array_unique( array_values( $indexed_columns ), SORT_REGULAR ) ) {
168168
throw new RuntimeException( 'Multiple indexes with the same column combinations.' );
169169
}
170170
}

0 commit comments

Comments
 (0)