Skip to content

Fix Domain EntityCollection#73

Merged
zigzagdev merged 1 commit intofeature/central-asiafrom
feature/central-asia-domain
Aug 24, 2025
Merged

Fix Domain EntityCollection#73
zigzagdev merged 1 commit intofeature/central-asiafrom
feature/central-asia-domain

Conversation

@zigzagdev
Copy link
Copy Markdown
Owner

what i have done

  • add new test pattern into EntityCollection test

@zigzagdev zigzagdev requested a review from Copilot August 24, 2025 09:34
@zigzagdev zigzagdev self-assigned this Aug 24, 2025
@zigzagdev zigzagdev linked an issue Aug 24, 2025 that may be closed by this pull request
@zigzagdev zigzagdev merged commit 46c47d3 into feature/central-asia Aug 24, 2025
1 check passed
@zigzagdev zigzagdev deleted the feature/central-asia-domain branch August 24, 2025 09:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds new test patterns to the EntityCollection test to support multi-country UNESCO World Heritage sites. The changes expand test coverage by adding database setup infrastructure and new test data for transnational heritage sites.

  • Adds database seeding and teardown methods for proper test isolation
  • Introduces new test data arrays for multi-country heritage sites
  • Adds new constructor parameters for state parties data to existing entity creation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +32 to +36
DB::connection('mysql')->statement('SET FOREIGN_KEY_CHECKS=0;');
WorldHeritage::truncate();
Country::truncate();
DB::table('site_state_parties')->truncate();
DB::connection('mysql')->statement('SET FOREIGN_KEY_CHECKS=1;');
Copy link

Copilot AI Aug 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoding 'mysql' connection breaks database abstraction. Use the default connection or make it configurable to support different database types in testing.

Suggested change
DB::connection('mysql')->statement('SET FOREIGN_KEY_CHECKS=0;');
WorldHeritage::truncate();
Country::truncate();
DB::table('site_state_parties')->truncate();
DB::connection('mysql')->statement('SET FOREIGN_KEY_CHECKS=1;');
$connection = DB::connection();
$driver = $connection->getDriverName();
if ($driver === 'mysql') {
$connection->statement('SET FOREIGN_KEY_CHECKS=0;');
}
WorldHeritage::truncate();
Country::truncate();
DB::table('site_state_parties')->truncate();
if ($driver === 'mysql') {
$connection->statement('SET FOREIGN_KEY_CHECKS=1;');
}

Copilot uses AI. Check for mistakes.
Comment on lines +32 to +36
DB::connection('mysql')->statement('SET FOREIGN_KEY_CHECKS=0;');
WorldHeritage::truncate();
Country::truncate();
DB::table('site_state_parties')->truncate();
DB::connection('mysql')->statement('SET FOREIGN_KEY_CHECKS=1;');
Copy link

Copilot AI Aug 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoding 'mysql' connection breaks database abstraction. Use the default connection or make it configurable to support different database types in testing.

Suggested change
DB::connection('mysql')->statement('SET FOREIGN_KEY_CHECKS=0;');
WorldHeritage::truncate();
Country::truncate();
DB::table('site_state_parties')->truncate();
DB::connection('mysql')->statement('SET FOREIGN_KEY_CHECKS=1;');
$driver = DB::getDriverName();
if ($driver === 'mysql') {
DB::statement('SET FOREIGN_KEY_CHECKS=0;');
}
WorldHeritage::truncate();
Country::truncate();
DB::table('site_state_parties')->truncate();
if ($driver === 'mysql') {
DB::statement('SET FOREIGN_KEY_CHECKS=1;');
}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Entity Collection for applying multi heritage

2 participants