diff options
author | javalizard <> | 2010-04-17 05:45:36 +0000 |
---|---|---|
committer | javalizard <> | 2010-04-17 05:45:36 +0000 |
commit | 98c48b76b2fdf4b99c9fad1631e52d027b965be4 (patch) | |
tree | 38d9971e4231a882d2fc59c53af9bb89dda2cd74 | |
parent | 34fb3ab1cbceb2e739578398748ded5524c46ad2 (diff) |
Got the return value nailed down for TList::InsertBefore and TList::insertAfter using the unit test.
-rw-r--r-- | framework/Collections/TList.php | 4 | ||||
-rw-r--r-- | tests/unit/Collections/TListTest.php | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/framework/Collections/TList.php b/framework/Collections/TList.php index cc0eab6d..cfcf666a 100644 --- a/framework/Collections/TList.php +++ b/framework/Collections/TList.php @@ -257,7 +257,7 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess,Countabl $this->insertAt($index, $item);
- return $this;
+ return $index;
}
/**
@@ -274,7 +274,7 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess,Countabl $this->insertAt($index + 1, $item);
- return $this;
+ return $index + 1;
}
/**
diff --git a/tests/unit/Collections/TListTest.php b/tests/unit/Collections/TListTest.php index 26f05e6f..e2ba654c 100644 --- a/tests/unit/Collections/TListTest.php +++ b/tests/unit/Collections/TListTest.php @@ -79,7 +79,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidDataValueException $e) { } $this->assertEquals(2,$this->list->getCount()); - $this->assertEquals($this->list,$this->list->insertBefore($this->item1,$this->item3)); + $this->assertEquals(0,$this->list->insertBefore($this->item1,$this->item3)); $this->assertEquals(3,$this->list->getCount()); $this->assertEquals(0,$this->list->indexOf($this->item3)); $this->assertEquals(1,$this->list->indexOf($this->item1)); @@ -93,7 +93,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidDataValueException $e) { } $this->assertEquals(2,$this->list->getCount()); - $this->assertEquals($this->list,$this->list->insertAfter($this->item2,$this->item3)); + $this->assertEquals(2,$this->list->insertAfter($this->item2,$this->item3)); $this->assertEquals(3,$this->list->getCount()); $this->assertEquals(0,$this->list->indexOf($this->item1)); $this->assertEquals(1,$this->list->indexOf($this->item2)); |