Created
June 2, 2011 18:07
-
-
Save ThePixelDeveloper/1004927 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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