File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change 1
- <?php /** @noinspection PhpUnhandledExceptionInspection */
1
+ <?php
2
+ /** @noinspection PhpUnhandledExceptionInspection */
2
3
3
4
/*
4
5
* BSD 3-Clause License
@@ -385,4 +386,29 @@ public function testSaveThrowsExceptionOnWrite()
385
386
$ this ->expectException ('RunTimeException ' );
386
387
$ changeLog ->save (vfsStream::url ('testFolder/changelog.md ' ));
387
388
}
389
+
390
+ public function testSetOptions ()
391
+ {
392
+ $ changeLog = new GitChangeLog ();
393
+
394
+ // Set multiple options at once.
395
+ $ changeLog ->setOptions ([
396
+ 'logHeader ' => 'Test1 ' ,
397
+ 'headSubject ' => 'Test2 ' ,
398
+ ]);
399
+ $ this ->assertEquals ('Test1 ' , $ this ->getPrivateProperty ($ changeLog , 'options ' )['logHeader ' ]);
400
+ $ this ->assertEquals ('Test2 ' , $ this ->getPrivateProperty ($ changeLog , 'options ' )['headSubject ' ]);
401
+
402
+ // Set single option.
403
+ $ changeLog ->setOptions ('logHeader ' , 'Test ' );
404
+ $ this ->assertEquals ('Test ' , $ this ->getPrivateProperty ($ changeLog , 'options ' )['logHeader ' ]);
405
+ }
406
+
407
+ public function testSetOptionsThrowsException ()
408
+ {
409
+ $ changeLog = new GitChangeLog ();
410
+
411
+ $ this ->expectException ('InvalidArgumentException ' );
412
+ $ changeLog ->setOptions ('NotExistingOption ' , 'Test ' );
413
+ }
388
414
}
You can’t perform that action at this time.
0 commit comments