diff --git a/base/test/classes/helpers/ArrayHelperTest.php b/base/test/classes/helpers/ArrayHelperTest.php index 6a903a87..83e72061 100644 --- a/base/test/classes/helpers/ArrayHelperTest.php +++ b/base/test/classes/helpers/ArrayHelperTest.php @@ -238,6 +238,28 @@ public function testValidateIdIsNumeric_OKArrayNotEmpty(){ $listArray[]=2; $this->assertNull( ArrayHelper::validateIsArray($listArray,__METHOD__,__LINE__) ); } + //----------------------------------------------------------------------------------- + //----------------------------------------------------------------------------------- + //----------------------------------------------------------------------------------- + /** + * @expectedException InvalidArgumentException + */ + public function testFormDinDeleteRowByKeyIndex_FailNull(){ + ArrayHelper::formDinDeleteRowByKeyIndex(null,10); + } + + public function testFormDinDeleteRowByKeyIndex_FailAttributeNotExist(){ + $mock = new mockFormDinArray(); + $array = $mock->generateTable(); + + $result = ArrayHelper::formDinDeleteRowByKeyIndex($array,10); + + $expected = false; + $this->assertEquals($expected, $result['result']); + $expected = TMessage::ARRAY_KEY_NOT_EXIST; + $this->assertEquals($expected, $result['message']); + } + //----------------------------------------------------------------------------------- //----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------