@@ -114,27 +114,40 @@ public function testCache()
114114 }
115115
116116 /**
117- * @param mixed $input
118- * @param int $output
117+ * @param int $value
119118 *
120- * @dataProvider provideFetchAttempts
119+ * @dataProvider provideValidFetchAttempts
121120 */
122- public function testMaxFetchAttempts ( $ input , $ output )
121+ public function testValidMaxFetchAttempts ( $ value )
123122 {
124- self ::assertSame ($ output , $ this ->specification ->setMaxFetchAttempts ($ input )->getMaxFetchAttempts ());
123+ self ::assertSame ($ value , $ this ->specification ->setMaxFetchAttempts ($ value )->getMaxFetchAttempts ());
125124 }
126125
127- public function provideFetchAttempts ()
126+ public function provideValidFetchAttempts ()
128127 {
129128 return [
130- // Valid.
131- [1 , 1 ],
132- [2 , 2 ],
133-
134- // Invalid.
135- 'Too low, positive ' => [0 , 1 ],
136- 'Too low, negative ' => [-1 , 1 ],
137- 'Float in range ' => [1.9 , 1 ],
129+ [1 ],
130+ [PHP_INT_MAX ],
131+ ];
132+ }
133+
134+ /**
135+ * @param mixed $value
136+ *
137+ * @dataProvider provideInvalidFetchAttempts
138+ */
139+ public function testInvalidMaxFetchAttempts ($ value )
140+ {
141+ $ this ->setExpectedException (\InvalidArgumentException::class);
142+ $ this ->specification ->setMaxFetchAttempts ($ value );
143+ }
144+
145+ public function provideInvalidFetchAttempts ()
146+ {
147+ return [
148+ 'Too low, positive ' => [0 ],
149+ 'Too low, negative ' => [-1 ],
150+ 'Float in range ' => [1.9 ],
138151 ];
139152 }
140153
0 commit comments