/usr/share/php/kohana3.2/system/tests/kohana/ViewTest.php is in libkohana3.2-core-php 3.2.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | <?php defined('SYSPATH') OR die('Kohana bootstrap needs to be included before tests run');
/**
* Tests the View class
*
* @group kohana
* @group kohana.core
* @group kohana.core.view
*
* @package Kohana
* @category Tests
* @author Kohana Team
* @copyright (c) 2008-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
class Kohana_ViewTest extends Unittest_TestCase
{
protected static $old_modules = array();
/**
* Setups the filesystem for test view files
*
* @return null
*/
public static function setupBeforeClass()
{
self::$old_modules = Kohana::modules();
$new_modules = self::$old_modules+array(
'test_views' => realpath(dirname(__FILE__).'/../test_data/')
);
Kohana::modules($new_modules);
}
/**
* Restores the module list
*
* @return null
*/
public static function teardownAfterClass()
{
Kohana::modules(self::$old_modules);
}
/**
* Provider for test_instaniate
*
* @return array
*/
public function provider_instantiate()
{
return array(
array('kohana/error', FALSE),
array('test.css', FALSE),
array('doesnt_exist', TRUE),
);
}
/**
* Tests that we can instantiate a view file
*
* @test
* @dataProvider provider_instantiate
*
* @return null
*/
public function test_instantiate($path, $expects_exception)
{
try
{
$view = new View($path);
$this->assertSame(FALSE, $expects_exception);
}
catch(View_Exception $e)
{
$this->assertSame(TRUE, $expects_exception);
}
}
}
|