77use PHPUnit \Framework \Attributes \Test ;
88use Stolt \LeanPackage \Analyser ;
99use Stolt \LeanPackage \Commands \RefreshCommand ;
10+ use Stolt \LeanPackage \Exceptions \PresetNotAvailable ;
1011use Stolt \LeanPackage \Presets \Finder ;
1112use Stolt \LeanPackage \Presets \PhpPreset ;
1213use Stolt \LeanPackage \Tests \TestCase ;
@@ -35,6 +36,9 @@ protected function tearDown(): void
3536 }
3637 }
3738
39+ /**
40+ * @throws PresetNotAvailable
41+ */
3842 #[Test]
3943 public function printsMergedContentWithoutWritingAFile (): void
4044 {
@@ -56,84 +60,28 @@ public function printsMergedContentWithoutWritingAFile(): void
5660 '--dry-run ' => true ,
5761 ]);
5862
59- $ this ->assertSame (0 , $ exitCode );
63+ $ this ->assertSame (Command:: SUCCESS , $ exitCode );
6064 $ this ->assertStringContainsString ('phpunit* ' , $ tester ->getDisplay ());
6165 $ this ->assertFileExists ($ this ->temporaryDirectory . DIRECTORY_SEPARATOR . '.lpv ' );
6266
63- $ expectedContent = <<<CONTENT
64- .*
65- *.txt
66- *.lock
67- SOME_FILE
68- .SOME_DIRECTORY/
69- AGENT.md
70- AGENTS.md
71- CLAUDE.md
72- GEMINI.md
73- AI.md
74- AIDER.md
75- CURSOR.md
76- COPILOT.md
77- CODEX.md
78- QWEN.md
79- WINDSURF.md
80- .aiassistant
81- .aider*
82- .cursor
83- .cursor/**
84- .github/copilot-instructions.md
85- .windsurf
86- .windsurf/**
87- .claude
88- .claude/**
89- .gemini
90- .gemini/**
91- .codex
92- .codex/**
93- llms.txt
94- llms-full.txt
95- *.{md,MD}
96- *.rst
97- *.toml
98- *.xml
99- *.yml
100- *.dist.*
101- .githooks
102- *.dist
103- {B,b}uild*
104- {D,d}ist
105- {D,d}oc*
106- {A,a}rt*
107- {A,a}sset*
108- {T,t}ool*
109- {T,t}est*
110- {S,s}pec*
111- {E,e}xample*
112- LICENSE
113- {M,m}ake
114- *.{png,gif,jpeg,jpg,webp}
115- phpunit*
116- appveyor.yml
117- box.json
118- composer-dependency-analyser*
119- collision-detector*
120- captainhook.json
121- peck.json
122- infection*
123- phpstan*
124- sonar*
125- rector*
126- phpkg.con*
127- package*
128- pint.{json,php}
129- renovate.json
130- *debugbar.json
131- phpinsights*
132- ecs*
133- RMT
134- {{M,m}ake,{B,b}ox,{V,v}agrant,{P,p}hulp}file
135-
136- CONTENT ;
67+ $ existingLines = [
68+ '.* ' ,
69+ '*.txt ' ,
70+ '*.lock ' ,
71+ 'SOME_FILE ' ,
72+ '.SOME_DIRECTORY/ ' ,
73+ ];
74+
75+ $ presetLines = (new Finder (new PhpPreset ()))->getPresetGlobByLanguageName ('PHP ' );
76+
77+ $ expectedLines = $ existingLines ;
78+ foreach ($ presetLines as $ presetLine ) {
79+ if (\in_array ($ presetLine , $ expectedLines , true )) { continue ; }
80+
81+ $ expectedLines [] = $ presetLine ;
82+ }
83+
84+ $ expectedContent = \implode (PHP_EOL , $ expectedLines ) . PHP_EOL ;
13785
13886 $ this ->assertSame ($ expectedContent , $ tester ->getDisplay ());
13987 }
0 commit comments