File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818use CaptainHook \App \Mockery as CHMockery ;
1919use Exception ;
2020use PHPUnit \Framework \TestCase ;
21+ use SebastianFeldmann \Git \Operator \Info ;
2122
2223class SuccessTest extends TestCase
2324{
@@ -47,4 +48,26 @@ public function testExecute(): void
4748
4849 $ this ->assertTrue (true );
4950 }
51+
52+ /**
53+ * Tests Debug::execute
54+ */
55+ public function testExecuteWithoutTags (): void
56+ {
57+ $ config = $ this ->createConfigMock (true );
58+ $ io = $ this ->createIOMock ();
59+ $ repository = $ this ->createRepositoryMock ();
60+ $ action = new Action ('\\' . Debug::class);
61+ $ infoOperator = $ this ->getMockBuilder (Info::class)->disableOriginalConstructor ()->getMock ();
62+ $ infoOperator ->method ('getCurrentTag ' )->willThrowException (new Exception ('foo ' ));
63+
64+ $ io ->expects ($ this ->once ())->method ('getArguments ' )->willReturn (['foo ' => 'bar ' ]);
65+ $ io ->expects ($ this ->atLeast (3 ))->method ('write ' );
66+ $ repository ->expects ($ this ->exactly (1 ))->method ('getInfoOperator ' )->willReturn ($ infoOperator );
67+
68+ $ debug = new Success ();
69+ $ debug ->execute ($ config , $ io , $ repository , $ action );
70+
71+ $ this ->assertTrue (true );
72+ }
5073}
You can’t perform that action at this time.
0 commit comments