File tree 4 files changed +9
-6
lines changed 4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 51
51
52
52
- name : " Install dependencies with Composer"
53
53
uses : " ramsey/composer-install@v2"
54
+
54
55
- name : " Run PHPUnit"
55
56
run : " vendor/bin/phpunit"
56
57
Original file line number Diff line number Diff line change 5
5
beStrictAboutOutputDuringTests =" true"
6
6
bootstrap =" vendor/autoload.php"
7
7
colors =" true"
8
- convertErrorsToExceptions =" true "
9
- convertNoticesToExceptions =" true "
10
- convertWarningsToExceptions =" true "
8
+ convertErrorsToExceptions =" false "
9
+ convertNoticesToExceptions =" false "
10
+ convertWarningsToExceptions =" false "
11
11
failOnRisky =" true"
12
12
failOnWarning =" true"
13
13
processIsolation =" false"
Original file line number Diff line number Diff line change @@ -75,9 +75,11 @@ private function loadFromFile()
75
75
]
76
76
]);
77
77
78
- if (is_array ($ data )) {
79
- $ this -> rates = $ data ;
78
+ if (false === is_array ($ data )) {
79
+ throw new Exception ( " Unserializable file content " ) ;
80
80
}
81
+
82
+ $ this ->rates = $ data ;
81
83
}
82
84
83
85
private function loadFromRemote ()
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ public function testRatesAreLoadedFromFile()
86
86
// test by invalidating file and testing for exception
87
87
file_put_contents ('vendor/rates ' , 'foobar ' );
88
88
$ rates = new Rates ('vendor/rates ' , 30 , $ client );
89
- $ this ->expectError (Error ::class);
89
+ $ this ->expectException (Exception ::class);
90
90
$ this ->assertEquals (21.0 , $ rates ->getRateForCountry ('NL ' ));
91
91
}
92
92
You can’t perform that action at this time.
0 commit comments