Skip to content

Instantly share code, notes, and snippets.

@ThePixelDeveloper
Created June 2, 2011 18:07
Show Gist options
  • Save ThePixelDeveloper/1004927 to your computer and use it in GitHub Desktop.
Save ThePixelDeveloper/1004927 to your computer and use it in GitHub Desktop.
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Tests the coaster download policy.
*
* @package Unittest
* @author Mathew Davies
*/
class Test_Coaster_Download_Policy extends Kohana_Unittest_TestCase
{
/**
*
*/
public function test_guest()
{
// User mock
$user = $this->getMock('Model_User', array('can', 'has', 'ratio'));
$user->expects($this->once())->method('can')->with('login')->will($this->returnValue(TRUE));
// File mock
$file = $this->getMock('Model_File');
$policy = new Policy_Coaster_Download;
$this->assertSame(Policy_Coaster_Download::NOT_LOGGED_IN, $policy->execute($user, array('coaster' => $file)));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment