From bcc233280ba736e27fae5d2e1f732b1a90220028 Mon Sep 17 00:00:00 2001 From: Markus Podar Date: Fri, 16 Feb 2024 21:38:43 +0100 Subject: [PATCH] [TEST] Show that custom phpdoc tags without space afterwards are unexpectedly changed (#981) * tests: show that custom phpdoc tags without space afterwards are unexpectedly changed This adds a test for the (current bug) behaviour of https://github.com/barryvdh/laravel-ide-helper/issues/666 If this ever gets fixed, this fails and needs to be adapted, ensuring it won't break again. * test: adapt now that #666 has been fixed --- .../CustomPhpdocTags/Models/Simple.php | 19 ++++++++++++ .../ModelsCommand/CustomPhpdocTags/Test.php | 30 +++++++++++++++++++ ...st__testNoSpaceAfterCustomPhpdocTag__1.php | 24 +++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 tests/Console/ModelsCommand/CustomPhpdocTags/Models/Simple.php create mode 100644 tests/Console/ModelsCommand/CustomPhpdocTags/Test.php create mode 100644 tests/Console/ModelsCommand/CustomPhpdocTags/__snapshots__/Test__testNoSpaceAfterCustomPhpdocTag__1.php diff --git a/tests/Console/ModelsCommand/CustomPhpdocTags/Models/Simple.php b/tests/Console/ModelsCommand/CustomPhpdocTags/Models/Simple.php new file mode 100644 index 0000000..368ad1c --- /dev/null +++ b/tests/Console/ModelsCommand/CustomPhpdocTags/Models/Simple.php @@ -0,0 +1,19 @@ +app->make(ModelsCommand::class); + + $tester = $this->runCommand($command, [ + '--write' => true, + ]); + + $this->assertSame(0, $tester->getStatusCode()); + $this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay()); + $this->assertMatchesMockedSnapshot(); + } +} diff --git a/tests/Console/ModelsCommand/CustomPhpdocTags/__snapshots__/Test__testNoSpaceAfterCustomPhpdocTag__1.php b/tests/Console/ModelsCommand/CustomPhpdocTags/__snapshots__/Test__testNoSpaceAfterCustomPhpdocTag__1.php new file mode 100644 index 0000000..6f883e1 --- /dev/null +++ b/tests/Console/ModelsCommand/CustomPhpdocTags/__snapshots__/Test__testNoSpaceAfterCustomPhpdocTag__1.php @@ -0,0 +1,24 @@ +