Kohana v3.3.5

This commit is contained in:
Deon George
2016-05-01 20:50:24 +10:00
parent 8888719653
commit 68c7f4f159
170 changed files with 4565 additions and 1176 deletions

View File

@@ -60,9 +60,23 @@ class Kohana_ViewTest extends Unittest_TestCase
);
}
/**
* Provider to test_set
*
* @return array
*/
public function provider_set()
{
return array(
array('foo', 'bar', 'foo', 'bar'),
array(array('foo' => 'bar'), NULL, 'foo', 'bar'),
array(new ArrayIterator(array('foo' => 'bar')), NULL, 'foo', 'bar'),
);
}
/**
* Tests that we can instantiate a view file
*
*
* @test
* @dataProvider provider_instantiate
*
@@ -80,4 +94,33 @@ class Kohana_ViewTest extends Unittest_TestCase
$this->assertSame(TRUE, $expects_exception);
}
}
/**
* Tests that we can set using string, array or Traversable object
*
* @test
* @dataProvider provider_set
*
* @return null
*/
public function test_set($data_key, $value, $test_key, $expected)
{
$view = View::factory()->set($data_key, $value);
$this->assertSame($expected, $view->$test_key);
}
/**
* Tests that we can set global using string, array or Traversable object
*
* @test
* @dataProvider provider_set
*
* @return null
*/
public function test_set_global($data_key, $value, $test_key, $expected)
{
$view = View::factory();
$view::set_global($data_key, $value);
$this->assertSame($expected, $view->$test_key);
}
}