Skip to content

Commit bbf6649

Browse files
committed
Add tests for errorFormat DIC parameter from CLI option
1 parent 96e1c27 commit bbf6649

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

tests/PHPStan/Command/CommandHelperTest.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,4 +319,47 @@ public function testResolveParameters(
319319
}
320320
}
321321

322+
public function testErrorFormatFromCli(): void
323+
{
324+
$result = CommandHelper::begin(
325+
new StringInput(''),
326+
new NullOutput(),
327+
[__DIR__],
328+
null,
329+
null,
330+
[],
331+
null,
332+
null,
333+
'0',
334+
false,
335+
false,
336+
null,
337+
null,
338+
false,
339+
'json',
340+
);
341+
$this->assertSame('json', $result->getContainer()->getParameter('errorFormat'));
342+
}
343+
344+
public function testErrorFormatDefault(): void
345+
{
346+
$result = CommandHelper::begin(
347+
new StringInput(''),
348+
new NullOutput(),
349+
[__DIR__],
350+
null,
351+
null,
352+
[],
353+
null,
354+
null,
355+
'0',
356+
false,
357+
false,
358+
null,
359+
null,
360+
false,
361+
);
362+
$this->assertNull($result->getContainer()->getParameter('errorFormat'));
363+
}
364+
322365
}

0 commit comments

Comments
 (0)