summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTaufan Aditya <toopay@taufanaditya.com>2012-03-28 11:35:48 +0200
committerTaufan Aditya <toopay@taufanaditya.com>2012-03-28 11:35:48 +0200
commit30b34d099e4e9bcdc79ec496fdb89904444eaa4f (patch)
treead384ceb38c490edfbee98d6488ca72d0c173f37 /tests
parentd44d720ba8b17fa58cb041111dca9c440f823446 (diff)
Implementation of Mock class, remove ugly reflection class
Diffstat (limited to 'tests')
-rw-r--r--tests/codeigniter/libraries/Table_test.php35
1 files changed, 3 insertions, 32 deletions
diff --git a/tests/codeigniter/libraries/Table_test.php b/tests/codeigniter/libraries/Table_test.php
index 04396d5fe..13f338c6b 100644
--- a/tests/codeigniter/libraries/Table_test.php
+++ b/tests/codeigniter/libraries/Table_test.php
@@ -100,42 +100,18 @@ class Table_test extends CI_TestCase {
array('data' => 'size')
);
- // test what would be discreet args,
- // basically means a single array as the calling method
- // will use func_get_args()
-
- $reflectionOfTable = new ReflectionClass($this->table);
- $method = $reflectionOfTable->getMethod('_prep_args');
-
- $method->setAccessible(true);
-
- $this->assertEquals(
- $expected,
- $method->invokeArgs(
- $this->table, array(array('name', 'color', 'size'), 'discreet')
- )
- );
-
- // test what would be a single array argument. Again, nested
- // due to func_get_args on calling methods
$this->assertEquals(
$expected,
- $method->invokeArgs(
- $this->table, array(array('name', 'color', 'size'), 'array')
- )
+ $this->table->prep_args(array('name', 'color', 'size'))
);
-
-
+
// with cell attributes
-
// need to add that new argument row to our expected outcome
$expected[] = array('data' => 'weight', 'class' => 'awesome');
$this->assertEquals(
$expected,
- $method->invokeArgs(
- $this->table, array(array('name', 'color', 'size', array('data' => 'weight', 'class' => 'awesome')), 'attributes')
- )
+ $this->table->prep_args(array('name', 'color', 'size', array('data' => 'weight', 'class' => 'awesome')))
);
}
@@ -236,11 +212,6 @@ class Table_test extends CI_TestCase {
public function test_set_from_array()
{
- $reflectionOfTable = new ReflectionClass($this->table);
- $method = $reflectionOfTable->getMethod('_set_from_array');
-
- $method->setAccessible(true);
-
$this->assertFalse($this->table->set_from_array('bogus'));
$this->assertFalse($this->table->set_from_array(NULL));