Skip to content

Issue #487 Create the test schema with migrations (Draft)#488

Merged
markstory merged 3 commits intocakephp:3.nextfrom
vierge-noire:master
Jun 14, 2021
Merged

Issue #487 Create the test schema with migrations (Draft)#488
markstory merged 3 commits intocakephp:3.nextfrom
vierge-noire:master

Conversation

@pabloelcolombiano
Copy link
Copy Markdown
Contributor

Implements the solution to issue #487 in the lines of the (CakePHP Test Migrator)[https://github.com/vierge-noire/cakephp-test-migrator].

@pabloelcolombiano pabloelcolombiano marked this pull request as draft May 10, 2021 21:57
@pabloelcolombiano
Copy link
Copy Markdown
Contributor Author

This will be marked as draft as long as the CakePHP 4.3 tag does not exist.

Comment thread src/TestSuite/Migrator.php Outdated
Comment thread src/TestSuite/Migrator.php Outdated
Comment thread src/TestSuite/Migrator.php Outdated
Comment thread src/TestSuite/Migrator.php
Copy link
Copy Markdown
Member

@markstory markstory left a comment

Choose a reason for hiding this comment

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

Looks good to move forward with. We'll need to update the docs as well.

protected function handleMigrationsStatus(array $configs): self
{
$connectionsToDrop = [];
foreach ($configs as &$config) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need a mutable reference to the configuration data?

$options = [];
foreach (['connection', 'plugin', 'source', 'target'] as $option) {
if (isset($config[$option])) {
$options[] = $option . ' "'.$config[$option].'"';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
$options[] = $option . ' "'.$config[$option].'"';
$options[] = $option . ' "' . $config[$option] . '"';

Our phpcs rules will get grumpy about the operator spacing.

Comment on lines +59 to +60
$Letters = TableRegistry::getTableLocator()->get('Letters');
$this->assertSame('test', $Letters->getConnection()->configName());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
$Letters = TableRegistry::getTableLocator()->get('Letters');
$this->assertSame('test', $Letters->getConnection()->configName());
$letters = TableRegistry::getTableLocator()->get('Letters');
$this->assertSame('test', $letters->getConnection()->configName());

* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) 2020 Juan Pablo Ramirez and Nicolas Masson
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We'll also need to add the CakePHP copyright to these files int addition to this copyright notice.

markstory added a commit to cakephp/app that referenced this pull request Jun 12, 2021
Using the schema dump file is not ideal. Once cakephp/migrations#488 is
merged I will update this to use migrations instead.
@markstory markstory changed the base branch from master to 3.next June 14, 2021 02:30
@markstory markstory marked this pull request as ready for review June 14, 2021 02:30
@markstory
Copy link
Copy Markdown
Member

Merging this so I can do integrated tests and document setup and how to upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants