Skip to content

Commit

Permalink
alter output so escaped namespace works
Browse files Browse the repository at this point in the history
update expected test output

fix cs checks

use " instead of '

amend test expectatioon to expect double quotes

add escape slashes again

fix expected testoutput
  • Loading branch information
delboy1978uk committed Nov 16, 2024
1 parent a3af231 commit f09f881
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions src/Tools/Console/Command/DiffCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ protected function execute(
}

$fqcn = $this->getDependencyFactory()->getClassNameGenerator()->generateClassName($namespace);

Check failure on line 130 in src/Tools/Console/Command/DiffCommand.php

View workflow job for this annotation

GitHub Actions / Coding Standards / Coding Standards (8.3)

Equals sign not aligned with surrounding assignments; expected 10 spaces but found 1 space

$diffGenerator = $this->getDependencyFactory()->getDiffGenerator();

try {
Expand All @@ -154,12 +153,12 @@ protected function execute(
sprintf('Generated new migration class to "<info>%s</info>"', $path),
'',
sprintf(
'To run just this migration for testing purposes, you can use <info>migrations:execute --up \'%s\'</info>',
'To run just this migration for testing purposes, you can use <info>migrations:execute --up "%s"</info>',
addslashes($fqcn),
),
'',
sprintf(
'To revert the migration you can use <info>migrations:execute --down \'%s\'</info>',
'To revert the migration you can use <info>migrations:execute --down "%s"</info>',
addslashes($fqcn),
),
'',
Expand Down
4 changes: 2 additions & 2 deletions src/Tools/Console/Command/DumpSchemaCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ public function execute(
sprintf('Dumped your schema to a new migration class at "<info>%s</info>"', $path),
'',
sprintf(
'To run just this migration for testing purposes, you can use <info>migrations:execute --up \'%s\'</info>',
'To run just this migration for testing purposes, you can use <info>migrations:execute --up "%s"</info>',
addslashes($fqcn),
),
'',
sprintf(
'To revert the migration you can use <info>migrations:execute --down \'%s\'</info>',
'To revert the migration you can use <info>migrations:execute --down "%s"</info>',
addslashes($fqcn),
),
'',
Expand Down
4 changes: 2 additions & 2 deletions tests/Tools/Console/Command/DiffCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ public function testExecute(): void
self::assertSame([
'Generated new migration class to "/path/to/migration.php"',
'',
'To run just this migration for testing purposes, you can use migrations:execute --up \'FooNs\\\\Version1234\'',
'To run just this migration for testing purposes, you can use migrations:execute --up "FooNs\\\\Version1234"',
'',
'To revert the migration you can use migrations:execute --down \'FooNs\\\\Version1234\'',
'To revert the migration you can use migrations:execute --down "FooNs\\\\Version1234"',
], array_map(trim(...), explode("\n", trim($output))));
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Tools/Console/Command/DumpSchemaCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ public function testExecute(): void
[
'Dumped your schema to a new migration class at ""',
'',
'To run just this migration for testing purposes, you can use migrations:execute --up \'FooNs\\\\Version1234\'',
'To run just this migration for testing purposes, you can use migrations:execute --up "FooNs\\\\Version1234"',
'',
'To revert the migration you can use migrations:execute --down \'FooNs\\\\Version1234\'',
'To revert the migration you can use migrations:execute --down "FooNs\\\\Version1234"',
'',
'To use this as a rollup migration you can use the migrations:rollup command.',
],
Expand Down

0 comments on commit f09f881

Please sign in to comment.