public function testAddToByIndexAndGetToArrayByIndex()
 {
     $getToArrayByIndex = getMethod('MailForm', 'getToArrayByIndex');
     $mailform = new MailForm();
     $mailform->addToByIndex(1, '*****@*****.**', 'to1');
     $tos = $getToArrayByIndex->invokeArgs($mailform, array(1));
     $this->assertCount(1, $tos);
     $this->assertArrayHasKey('*****@*****.**', $tos);
     $this->assertEquals('to1', $tos['*****@*****.**']);
     $mailform->addToByIndex(1, '*****@*****.**', 'to2');
     $tos = $getToArrayByIndex->invokeArgs($mailform, array(1));
     $this->assertCount(2, $tos);
     $this->assertArrayHasKey('*****@*****.**', $tos);
     $this->assertEquals('to2', $tos['*****@*****.**']);
     $mailform->addToByIndex(2, '*****@*****.**', 'to3');
     $tos = $getToArrayByIndex->invokeArgs($mailform, array(2));
     $this->assertCount(1, $tos);
     $this->assertArrayHasKey('*****@*****.**', $tos);
     $this->assertEquals('to3', $tos['*****@*****.**']);
 }