44use CodeIgniter \Files \Exceptions \FileNotFoundException ;
55use DateTime ;
66use DateTimeZone ;
7- use BadMethodCallException ;
8- use InvalidArgumentException ;
9- use LogicException ;
7+ use CodeIgniter \Exceptions \DownloadException ;
108
119class DownloadResponseTest extends \CIUnitTestCase
1210{
@@ -119,15 +117,15 @@ public function testCantSetCache()
119117 {
120118 $ response = new DownloadResponse ('unit-test.txt ' , true );
121119
122- $ this ->expectException (BadMethodCallException ::class);
120+ $ this ->expectException (DownloadException ::class);
123121 $ response ->setCache ();
124122 }
125123
126124 public function testWhenFilepathIsSetBinaryCanNotBeSet ()
127125 {
128126 $ response = new DownloadResponse ('unit-test.txt ' , true );
129127
130- $ this ->expectException (BadMethodCallException ::class);
128+ $ this ->expectException (DownloadException ::class);
131129 $ response ->setFilePath (__FILE__ );
132130 $ response ->setBinary ('test ' );
133131 }
@@ -136,7 +134,7 @@ public function testWhenBinaryIsSetFilepathCanNotBeSet()
136134 {
137135 $ response = new DownloadResponse ('unit-test.txt ' , true );
138136
139- $ this ->expectException (BadMethodCallException ::class);
137+ $ this ->expectException (DownloadException ::class);
140138 $ response ->setBinary ('test ' );
141139 $ response ->setFilePath (__FILE__ );
142140 }
@@ -248,7 +246,7 @@ public function testThrowExceptionWhenNoSetDownloadSource()
248246 {
249247 $ response = new DownloadResponse ('unit-test.php ' , false );
250248
251- $ this ->expectException (LogicException ::class);
249+ $ this ->expectException (DownloadException ::class);
252250 $ response ->sendBody ();
253251 }
254252}
0 commit comments