|
21 | 21 | /** Test keyfiles download controller. */
|
22 | 22 | class Keyfiles_DownloadControllerTest extends ControllerTestCase
|
23 | 23 | {
|
24 |
| - /** Set up tests. */ |
25 |
| - public function setUp() |
26 |
| - { |
27 |
| - $this->setupDatabase(array('default')); //core dataset |
28 |
| - $this->enabledModules = array('keyfiles'); |
29 |
| - $this->_models = array('Bitstream', 'Item', 'User'); |
| 24 | + /** Set up tests. */ |
| 25 | + public function setUp() |
| 26 | + { |
| 27 | + $this->setupDatabase(array('default')); //core dataset |
| 28 | + $this->enabledModules = array('keyfiles'); |
| 29 | + $this->_models = array('Bitstream', 'Item', 'User'); |
30 | 30 |
|
31 |
| - parent::setUp(); |
32 |
| - } |
| 31 | + parent::setUp(); |
| 32 | + } |
33 | 33 |
|
34 |
| - /** Test downloading of a single bitstream key file. */ |
35 |
| - public function testDownloadBitstreamKeyfile() |
36 |
| - { |
37 |
| - $usersFile = $this->loadData('User', 'default'); |
38 |
| - $bitstreamsFile = $this->loadData('Bitstream', 'default'); |
39 |
| - $userDao = $this->User->load($usersFile[2]->getKey()); |
40 |
| - $bitstreamDao = $this->Bitstream->load($bitstreamsFile[0]->getKey()); |
| 34 | + /** Test downloading of a single bitstream key file. */ |
| 35 | + public function testDownloadBitstreamKeyfile() |
| 36 | + { |
| 37 | + $usersFile = $this->loadData('User', 'default'); |
| 38 | + $bitstreamsFile = $this->loadData('Bitstream', 'default'); |
| 39 | + $userDao = $this->User->load($usersFile[2]->getKey()); |
| 40 | + $bitstreamDao = $this->Bitstream->load($bitstreamsFile[0]->getKey()); |
41 | 41 |
|
42 |
| - $url = '/keyfiles/download/bitstream?bitstreamId='.$bitstreamDao->getKey(); |
| 42 | + $url = '/keyfiles/download/bitstream?bitstreamId='.$bitstreamDao->getKey(); |
43 | 43 |
|
44 |
| - // Should throw an exception for no bitstream parameter |
45 |
| - $this->dispatchUrl('/keyfiles/download/bitstream', null, true); |
| 44 | + // Should throw an exception for no bitstream parameter |
| 45 | + $this->dispatchUrl('/keyfiles/download/bitstream', null, true); |
46 | 46 |
|
47 |
| - // Make sure we get the checksum as the response |
48 |
| - $this->resetAll(); |
49 |
| - $this->dispatchUrl($url, $userDao); |
50 |
| - $this->assertEquals($bitstreamDao->getChecksum(), $this->getBody()); |
51 |
| - } |
| 47 | + // Make sure we get the checksum as the response |
| 48 | + $this->resetAll(); |
| 49 | + $this->dispatchUrl($url, $userDao); |
| 50 | + $this->assertEquals($bitstreamDao->getChecksum(), $this->getBody()); |
| 51 | + } |
52 | 52 |
|
53 |
| - /** Test downloading of a recursive zip of keyfiles. */ |
54 |
| - public function testDownloadZip() |
55 |
| - { |
56 |
| - // Should throw an exception for no bitstream parameter |
57 |
| - $this->dispatchUrl('/keyfiles/download/batch', null, true); |
| 53 | + /** Test downloading of a recursive zip of keyfiles. */ |
| 54 | + public function testDownloadZip() |
| 55 | + { |
| 56 | + // Should throw an exception for no bitstream parameter |
| 57 | + $this->dispatchUrl('/keyfiles/download/batch', null, true); |
58 | 58 |
|
59 |
| - // Get some coverage on the batch controller |
60 |
| - $this->resetAll(); |
61 |
| - $this->dispatchUrl('/keyfiles/download/batch?items=1-2-3-&folders=1000', null); |
62 |
| - $this->assertController('download'); |
63 |
| - $this->assertAction('batch'); |
64 |
| - } |
| 59 | + // Get some coverage on the batch controller |
| 60 | + $this->resetAll(); |
| 61 | + $this->dispatchUrl('/keyfiles/download/batch?items=1-2-3-&folders=1000', null); |
| 62 | + $this->assertController('download'); |
| 63 | + $this->assertAction('batch'); |
| 64 | + } |
65 | 65 | }
|
0 commit comments