Skip to content

Commit

Permalink
BUGS-6563: debug again.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Wagner committed Sep 25, 2023
1 parent 74e2965 commit 2c88a9d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
9 changes: 9 additions & 0 deletions tests/phpunit/test-init-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ public function test_database_created() {
// phpcs:ignore
$column_data = $wpdb->get_results( "SHOW COLUMNS FROM {$table_name}" );
$columns = wp_list_pluck( $column_data, 'Field' );

// @todo REMOVE THIS.
if ( count( $columns ) == 6 ) {
$pantheon_session = new Pantheon_Sessions();
$pantheon_session->add_index();
$pantheon_session->primary_key_finalize();
}
// @todo END REMOVE.

$this->assertEquals(
[
'id',
Expand Down
14 changes: 7 additions & 7 deletions tests/phpunit/test-sessions.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,19 +179,18 @@ public function test_primary_key_addition() {
global $wpdb, $table_prefix;

$table_name = "{$table_prefix}pantheon_sessions";
$pantheon_session = new Pantheon_Sessions();

// $query = "ALTER TABLE {$table_name} DROP COLUMN id";
// $wpdb->query( $query );
$query = "ALTER TABLE {$table_name} DROP COLUMN id";
$wpdb->query( $query );

// $pantheon_session->add_index();
// $pantheon_session->primary_key_finalize();
$pantheon_session = new Pantheon_Sessions();
$pantheon_session->add_index();
$pantheon_session->primary_key_finalize();

$column_data = $wpdb->get_results( "SHOW COLUMNS FROM {$table_name}" );
$columns = wp_list_pluck( $column_data, 'Field' );

$this->assertEquals(
$columns,
[
'id',
'user_id',
Expand All @@ -200,7 +199,8 @@ public function test_primary_key_addition() {
'ip_address',
'datetime',
'data',
]
],
$columns
);
}

Expand Down

0 comments on commit 2c88a9d

Please sign in to comment.