/usr/share/php/kohana2/modules/unit_test/tests/Example_Test.php is in libkohana2-modules-php 2.3.4-2.
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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | <?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* Example Test.
*
* $Id: Example_Test.php 3769 2008-12-15 00:48:56Z zombor $
*
* @package Unit_Test
* @author Kohana Team
* @copyright (c) 2007-2008 Kohana Team
* @license http://kohanaphp.com/license.html
*/
class Example_Test extends Unit_Test_Case {
// Disable this Test class?
const DISABLED = FALSE;
public $setup_has_run = FALSE;
public function setup()
{
$this->setup_has_run = TRUE;
}
public function setup_test()
{
$this->assert_true_strict($this->setup_has_run);
}
public function true_false_test()
{
$var = TRUE;
$this
->assert_true($var)
->assert_true_strict($var)
->assert_false( ! $var)
->assert_false_strict( ! $var);
}
public function equal_same_test()
{
$var = '5';
$this
->assert_equal($var, 5)
->assert_not_equal($var, 6)
->assert_same($var, '5')
->assert_not_same($var, 5);
}
public function type_test()
{
$this
->assert_boolean(TRUE)
->assert_not_boolean('TRUE')
->assert_integer(123)
->assert_not_integer('123')
->assert_float(1.23)
->assert_not_float(123)
->assert_array(array(1, 2, 3))
->assert_not_array('array()')
->assert_object(new stdClass)
->assert_not_object('X')
->assert_null(NULL)
->assert_not_null(0)
->assert_empty('0')
->assert_not_empty('1');
}
public function pattern_test()
{
$var = "Kohana\n";
$this
->assert_pattern($var, '/^Kohana$/')
->assert_not_pattern($var, '/^Kohana$/D');
}
public function array_key_test()
{
$array = array('a' => 'A', 'b' => 'B');
$this->assert_array_key('a', $array);
}
public function in_array_test()
{
$array = array('X', 'Y', 'Z');
$this->assert_in_array('X', $array);
}
public function debug_example_test()
{
foreach (array(1, 5, 6, 12, 65, 128, 9562) as $var)
{
// By supplying $var in the debug parameter,
// we can see on which number this test fails.
$this->assert_true($var < 100, $var);
}
}
public function error_test()
{
throw new Exception;
}
}
|