Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
Fix style errors in download controller
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Snape committed May 26, 2015
1 parent b9532d6 commit 4e96f54
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 41 deletions.
14 changes: 7 additions & 7 deletions modules/demo/constant/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
define('MIDAS_DEMO_USER_PASSWORD', 'user');

define('MIDAS_DEMO_DYNAMIC_HELP', '
<b>To authenticate:</b><br /><br />
Demo Administrator<br />
- Login: '.MIDAS_DEMO_ADMIN_EMAIL.'<br />
- Password: '.MIDAS_DEMO_ADMIN_PASSWORD.'<br /><br />
Demo User<br />
- Login: '.MIDAS_DEMO_USER_EMAIL.'<br />
- Password: '.MIDAS_DEMO_USER_PASSWORD);
<b>To authenticate:</b><br /><br />
Demo Administrator<br />
- Login: '.MIDAS_DEMO_ADMIN_EMAIL.'<br />
- Password: '.MIDAS_DEMO_ADMIN_PASSWORD.'<br /><br />
Demo User<br />
- Login: '.MIDAS_DEMO_USER_EMAIL.'<br />
- Password: '.MIDAS_DEMO_USER_PASSWORD);
68 changes: 34 additions & 34 deletions modules/keyfiles/tests/controllers/DownloadControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,45 +21,45 @@
/** Test keyfiles download controller. */
class Keyfiles_DownloadControllerTest extends ControllerTestCase
{
/** Set up tests. */
public function setUp()
{
$this->setupDatabase(array('default')); //core dataset
$this->enabledModules = array('keyfiles');
$this->_models = array('Bitstream', 'Item', 'User');
/** Set up tests. */
public function setUp()
{
$this->setupDatabase(array('default')); //core dataset
$this->enabledModules = array('keyfiles');
$this->_models = array('Bitstream', 'Item', 'User');

parent::setUp();
}
parent::setUp();
}

/** Test downloading of a single bitstream key file. */
public function testDownloadBitstreamKeyfile()
{
$usersFile = $this->loadData('User', 'default');
$bitstreamsFile = $this->loadData('Bitstream', 'default');
$userDao = $this->User->load($usersFile[2]->getKey());
$bitstreamDao = $this->Bitstream->load($bitstreamsFile[0]->getKey());
/** Test downloading of a single bitstream key file. */
public function testDownloadBitstreamKeyfile()
{
$usersFile = $this->loadData('User', 'default');
$bitstreamsFile = $this->loadData('Bitstream', 'default');
$userDao = $this->User->load($usersFile[2]->getKey());
$bitstreamDao = $this->Bitstream->load($bitstreamsFile[0]->getKey());

$url = '/keyfiles/download/bitstream?bitstreamId='.$bitstreamDao->getKey();
$url = '/keyfiles/download/bitstream?bitstreamId='.$bitstreamDao->getKey();

// Should throw an exception for no bitstream parameter
$this->dispatchUrl('/keyfiles/download/bitstream', null, true);
// Should throw an exception for no bitstream parameter
$this->dispatchUrl('/keyfiles/download/bitstream', null, true);

// Make sure we get the checksum as the response
$this->resetAll();
$this->dispatchUrl($url, $userDao);
$this->assertEquals($bitstreamDao->getChecksum(), $this->getBody());
}
// Make sure we get the checksum as the response
$this->resetAll();
$this->dispatchUrl($url, $userDao);
$this->assertEquals($bitstreamDao->getChecksum(), $this->getBody());
}

/** Test downloading of a recursive zip of keyfiles. */
public function testDownloadZip()
{
// Should throw an exception for no bitstream parameter
$this->dispatchUrl('/keyfiles/download/batch', null, true);
/** Test downloading of a recursive zip of keyfiles. */
public function testDownloadZip()
{
// Should throw an exception for no bitstream parameter
$this->dispatchUrl('/keyfiles/download/batch', null, true);

// Get some coverage on the batch controller
$this->resetAll();
$this->dispatchUrl('/keyfiles/download/batch?items=1-2-3-&folders=1000', null);
$this->assertController('download');
$this->assertAction('batch');
}
// Get some coverage on the batch controller
$this->resetAll();
$this->dispatchUrl('/keyfiles/download/batch?items=1-2-3-&folders=1000', null);
$this->assertController('download');
$this->assertAction('batch');
}
}

0 comments on commit 4e96f54

Please sign in to comment.