66
77use Exception ;
88use FriendsOfPhpSpec \PhpSpec \CodeCoverage \CodeCoverageExtension ;
9+ use FriendsOfPhpSpec \PhpSpec \CodeCoverage \CodeCoverageOptions ;
910use PhpSpec \ObjectBehavior ;
1011use PhpSpec \ServiceContainer \IndexedServiceContainer ;
1112
@@ -25,9 +26,10 @@ public function it_should_allow_to_set_show_only_summary_option(): void
2526 $ container ->setParam ('code_coverage ' , ['show_only_summary ' => true ]);
2627 $ this ->load ($ container );
2728
29+ /** @var CodeCoverageOptions $options */
2830 $ options = $ container ->get ('code_coverage.options ' );
2931
30- if (true !== $ options[ ' show_only_summary ' ] ) {
32+ if (true !== $ options-> showOnlySummary () ) {
3133 throw new Exception ('show_only_summary was not set ' );
3234 }
3335 }
@@ -37,9 +39,10 @@ public function it_should_not_use_show_only_summary_option_by_default(): void
3739 $ container = new IndexedServiceContainer ();
3840 $ this ->load ($ container , []);
3941
42+ /** @var CodeCoverageOptions $options */
4043 $ options = $ container ->get ('code_coverage.options ' );
4144
42- if (false !== $ options[ ' show_only_summary ' ] ) {
45+ if (false !== $ options-> showOnlySummary () ) {
4346 throw new Exception ('show_only_summary should be `false` by default ' );
4447 }
4548 }
@@ -50,9 +53,10 @@ public function it_should_transform_format_into_array(): void
5053 $ container ->setParam ('code_coverage ' , ['format ' => 'html ' ]);
5154 $ this ->load ($ container );
5255
56+ /** @var CodeCoverageOptions $options */
5357 $ options = $ container ->get ('code_coverage.options ' );
5458
55- if ($ options[ ' format ' ] !== ['html ' ]) {
59+ if ($ options-> getFormats () !== ['html ' ]) {
5660 throw new Exception ('Default format is not transformed to an array ' );
5761 }
5862 }
@@ -62,9 +66,10 @@ public function it_should_use_html_format_by_default(): void
6266 $ container = new IndexedServiceContainer ();
6367 $ this ->load ($ container , []);
6468
69+ /** @var CodeCoverageOptions $options */
6570 $ options = $ container ->get ('code_coverage.options ' );
6671
67- if ($ options[ ' format ' ] !== ['html ' ]) {
72+ if ($ options-> getFormats () !== ['html ' ]) {
6873 throw new Exception ('Default format is not html ' );
6974 }
7075 }
@@ -75,9 +80,10 @@ public function it_should_use_singular_output(): void
7580 $ container ->setParam ('code_coverage ' , ['output ' => 'test ' , 'format ' => 'foo ' ]);
7681 $ this ->load ($ container );
7782
83+ /** @var CodeCoverageOptions $options */
7884 $ options = $ container ->get ('code_coverage.options ' );
7985
80- if (['foo ' => 'test ' ] !== $ options[ ' output ' ] ) {
86+ if (['foo ' => 'test ' ] !== $ options-> getOutputPaths () ) {
8187 throw new Exception ('Default format is not singular output ' );
8288 }
8389 }
0 commit comments