Skip to content

Commit

Permalink
Manually merging in 3.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
BRMatt committed Sep 5, 2010
2 parents 113f0da + 012584e commit 38b842a
Show file tree
Hide file tree
Showing 22 changed files with 313 additions and 261 deletions.
56 changes: 28 additions & 28 deletions tests/kohana/ArrTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* @return array
*/
function provider_callback()
public function provider_callback()
{
return array(
// Tests....
Expand All @@ -44,7 +44,7 @@ function provider_callback()
* @param string $str String to parse
* @param array $expected Callback and its parameters
*/
function test_callback($str, $expected)
public function test_callback($str, $expected)
{
$result = Arr::callback($str);

Expand All @@ -57,7 +57,7 @@ function test_callback($str, $expected)
*
* @return array
*/
function provider_extract()
public function provider_extract()
{
return array(
array(
Expand Down Expand Up @@ -87,7 +87,7 @@ function provider_extract()
* @param mixed $default
* @param array $expected
*/
function test_extract(array $array, array $keys, $default, $expected)
public function test_extract(array $array, array $keys, $default, $expected)
{
$array = Arr::extract($array, $keys, $default);

Expand All @@ -101,7 +101,7 @@ function test_extract(array $array, array $keys, $default, $expected)
*
* @return array
*/
function provider_get()
public function provider_get()
{
return array(
array(array('uno', 'dos', 'tress'), 1, NULL, 'dos'),
Expand All @@ -124,7 +124,7 @@ function provider_get()
* @param mixed $default What to return if $key isn't set
* @param mixed $expected The expected value returned
*/
function test_get(array $array, $key, $default, $expected)
public function test_get(array $array, $key, $default, $expected)
{
$this->assertSame(
$expected,
Expand All @@ -137,7 +137,7 @@ function test_get(array $array, $key, $default, $expected)
*
* @return array
*/
function provider_is_assoc()
public function provider_is_assoc()
{
return array(
array(array('one', 'two', 'three'), FALSE),
Expand All @@ -153,15 +153,15 @@ function provider_is_assoc()
* @param array $array Array to check
* @param boolean $expected Is $array assoc
*/
function test_is_assoc(array $array, $expected)
public function test_is_assoc(array $array, $expected)
{
$this->assertSame(
$expected,
Arr::is_assoc($array)
);
}

function provider_merge()
public function provider_merge()
{
return array(
// Test how it merges arrays and sub arrays with assoc keys
Expand Down Expand Up @@ -206,7 +206,7 @@ function provider_merge()
* @test
* @dataProvider provider_merge
*/
function test_merge($expected, $array1, $array2)
public function test_merge($expected, $array1, $array2)
{
$this->assertSame(
$expected,
Expand All @@ -219,7 +219,7 @@ function test_merge($expected, $array1, $array2)
*
* @return array
*/
function provider_path()
public function provider_path()
{
$array = array(
'foobar' => array('definition' => 'lost'),
Expand Down Expand Up @@ -262,7 +262,7 @@ function provider_path()
* @param mixed $default The value to return if dnx
* @param boolean $expected The expected value
*/
function test_path($expected, $array, $path, $default = NULL)
public function test_path($expected, $array, $path, $default = NULL)
{
$this->assertSame(
$expected,
Expand All @@ -275,7 +275,7 @@ function test_path($expected, $array, $path, $default = NULL)
*
* @return array
*/
function provider_range()
public function provider_range()
{
return array(
array(1, 2),
Expand All @@ -291,7 +291,7 @@ function provider_range()
* @param integer $step The step between each value in the array
* @param integer $max The max value of the range (inclusive)
*/
function test_range($step, $max)
public function test_range($step, $max)
{
$range = Arr::range($step, $max);

Expand All @@ -313,7 +313,7 @@ function test_range($step, $max)
*
* @return array
*/
function provider_unshift()
public function provider_unshift()
{
return array(
array(array('one' => '1', 'two' => '2',), 'zero', '0'),
Expand All @@ -330,7 +330,7 @@ function provider_unshift()
* @param string $key
* @param mixed $value
*/
function test_unshift(array $array, $key, $value)
public function test_unshift(array $array, $key, $value)
{
$original = $array;

Expand All @@ -349,7 +349,7 @@ function test_unshift(array $array, $key, $value)
*
* @return array Test Data
*/
function provider_overwrite()
public function provider_overwrite()
{
return array(
array(
Expand All @@ -366,7 +366,7 @@ function provider_overwrite()
* @test
* @dataProvider provider_overwrite
*/
function test_overwrite($expected, $arr1, $arr2, $arr3 = array(), $arr4 = array())
public function test_overwrite($expected, $arr1, $arr2, $arr3 = array(), $arr4 = array())
{
$this->assertSame(
$expected,
Expand All @@ -379,7 +379,7 @@ function test_overwrite($expected, $arr1, $arr2, $arr3 = array(), $arr4 = array(
*
* @return array Test Data
*/
function provider_binary_search()
public function provider_binary_search()
{
return array(
array(2, 'john', array('mary', 'louise', 'john', 'kent'))
Expand All @@ -391,7 +391,7 @@ function provider_binary_search()
* @test
* @dataProvider provider_binary_search
*/
function test_binary_search($expected, $needle, $haystack, $sort = FALSE)
public function test_binary_search($expected, $needle, $haystack, $sort = FALSE)
{
$this->assertSame(
$expected,
Expand All @@ -400,11 +400,11 @@ function test_binary_search($expected, $needle, $haystack, $sort = FALSE)
}

/**
* Provides test data for testMap
* Provides test data for test_map
*
* @return array Test Data
*/
function providerMap()
public function provider_map()
{
return array(
array('strip_tags', array('<p>foobar</p>'), array('foobar')),
Expand All @@ -415,9 +415,9 @@ function providerMap()
/**
*
* @test
* @dataProvider providermap
* @dataProvider provider_map
*/
function testMap($method, $source, $expected)
public function test_map($method, $source, $expected)
{
$this->assertSame(
$expected,
Expand All @@ -426,11 +426,11 @@ function testMap($method, $source, $expected)
}

/**
* Provides test data for testFlatten
* Provides test data for test_flatten
*
* @return array Test Data
*/
function providerFlatten()
public function provider_flatten()
{
return array(
array(array('set' => array('one' => 'something'), 'two' => 'other'), array('one' => 'something', 'two' => 'other')),
Expand All @@ -440,9 +440,9 @@ function providerFlatten()
/**
*
* @test
* @dataProvider providerFlatten
* @dataProvider provider_flatten
*/
function testFlatten($source, $expected)
public function test_flatten($source, $expected)
{
$this->assertSame(
$expected,
Expand Down
14 changes: 7 additions & 7 deletions tests/kohana/CLITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
*
* PHPUnit automatically backups up & restores global variables
*/
function setUp()
public function setUp()
{
parent::setUp();

Expand Down Expand Up @@ -71,7 +71,7 @@ function setUp()
*
* @test
*/
function test_only_loops_over_available_arguments()
public function test_only_loops_over_available_arguments()
{
++$_SERVER['argc'];

Expand All @@ -85,7 +85,7 @@ function test_only_loops_over_available_arguments()
*
* @test
*/
function test_only_parses_wanted_arguments()
public function test_only_parses_wanted_arguments()
{
$options = CLI::options('uri');

Expand All @@ -100,7 +100,7 @@ function test_only_parses_wanted_arguments()
*
* @test
*/
function test_does_not_parse_invalid_arguments()
public function test_does_not_parse_invalid_arguments()
{
$options = CLI::options('uri', 'invalid');

Expand All @@ -114,7 +114,7 @@ function test_does_not_parse_invalid_arguments()
*
* @test
*/
function test_parses_multiple_arguments()
public function test_parses_multiple_arguments()
{
$options = CLI::options('uri', 'version');

Expand All @@ -130,7 +130,7 @@ function test_parses_multiple_arguments()
*
* @test
*/
function test_parses_arguments_without_value_as_null()
public function test_parses_arguments_without_value_as_null()
{
$options = CLI::options('uri', 'we_are_cool');

Expand All @@ -144,7 +144,7 @@ function test_parses_arguments_without_value_as_null()
* @test
* @ticket 2642
*/
function test_cli_only_splits_on_the_first_equals()
public function test_cli_only_splits_on_the_first_equals()
{
$options = CLI::options('important');

Expand Down
16 changes: 8 additions & 8 deletions tests/kohana/CookieTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* @return array
*/
function provider_set()
public function provider_set()
{
return array(
array('foo', 'bar', NULL, TRUE),
Expand All @@ -37,7 +37,7 @@ function provider_set()
* @param mixed $exp exp to set
* @param boolean $expected Output for cookie::set()
*/
function test_set($key, $value, $exp, $expected)
public function test_set($key, $value, $exp, $expected)
{
$this->assertSame($expected, cookie::set($key, $value, $exp));
}
Expand All @@ -47,7 +47,7 @@ function test_set($key, $value, $exp, $expected)
*
* @return array
*/
function provider_get()
public function provider_get()
{
return array(
array('foo', Cookie::salt('foo', 'bar').'~bar', 'bar'),
Expand All @@ -66,7 +66,7 @@ function provider_get()
* @param mixed $value value to set
* @param boolean $expected Output for cookie::get()
*/
function test_get($key, $value, $expected)
public function test_get($key, $value, $expected)
{
// Force $_COOKIE
if ($key !== NULL)
Expand All @@ -80,7 +80,7 @@ function test_get($key, $value, $expected)
*
* @return array
*/
function provider_delete()
public function provider_delete()
{
return array(
array('foo', TRUE),
Expand All @@ -96,7 +96,7 @@ function provider_delete()
* @param mixed $key key to use
* @param boolean $expected Output for cookie::delete()
*/
function test_delete($key, $expected)
public function test_delete($key, $expected)
{
$this->assertSame($expected, cookie::delete($key));
}
Expand All @@ -106,7 +106,7 @@ function test_delete($key, $expected)
*
* @return array
*/
function provider_salt()
public function provider_salt()
{
return array(
array('foo', 'bar', '795317c9df04d8061e6e134a9b3487dc9ad69117'),
Expand All @@ -123,7 +123,7 @@ function provider_salt()
* @param mixed $value value to salt with
* @param boolean $expected Output for cookie::delete()
*/
function test_salt($key, $value, $expected)
public function test_salt($key, $value, $expected)
{
$this->assertSame($expected, cookie::salt($key, $value));
}
Expand Down
Loading

0 comments on commit 38b842a

Please sign in to comment.