From 008e1f242fb77117791d476222fed0a65fc253d2 Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Sun, 6 Dec 2020 05:09:29 +0200 Subject: [PATCH] Use preamble in filename generation Additionally enable Psalm cache (this is expected to fail builds until vimeo/psalm#4789 is merged/released). --- src/Module.php | 2 +- tests/_support/AcceptanceTester.php | 9 +++++++++ tests/acceptance/PsalmModule.feature | 24 +++++++++++++----------- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/Module.php b/src/Module.php index a129361..66b8791 100644 --- a/src/Module.php +++ b/src/Module.php @@ -322,7 +322,7 @@ public function haveTheFollowingCode(string $code): void $file = sprintf( '%s/%s.php', rtrim($this->config['default_dir'], '/'), - sha1($code) + sha1($this->preamble . $code) ); $this->fs()->writeToFile( diff --git a/tests/_support/AcceptanceTester.php b/tests/_support/AcceptanceTester.php index b60a5c9..c4f544a 100644 --- a/tests/_support/AcceptanceTester.php +++ b/tests/_support/AcceptanceTester.php @@ -1,4 +1,5 @@ writeToFile('tests/_run/composer.lock', '{}'); + } } diff --git a/tests/acceptance/PsalmModule.feature b/tests/acceptance/PsalmModule.feature index fd3c71e..8251e9c 100644 --- a/tests/acceptance/PsalmModule.feature +++ b/tests/acceptance/PsalmModule.feature @@ -9,6 +9,8 @@ Feature: Psalm module