/**
  * Test limitNumberOfMailsByAmount - Check if old messages where deleted first.
  * The LogRotation supports the limitation of stored mails by amount.
  * This test checks if old messages are deleted first by asserting that after the policy is run the oldest mail is gone.
  * @since 1.6.0
  * @see WPML_LogRotation::limitNumberOfMailsByAmount
  */
 function test_limitNumberOfMailsByAmount_order()
 {
     global $wpml_settings;
     $amount = 10;
     $keep = 3;
     $this->prepareMessages($amount);
     $wpml_settings['log-rotation-limit-amout'] = '1';
     $wpml_settings['log-rotation-limit-amout-keep'] = $keep;
     $oldest_mail_id = $this->oldest_mail()->get_mail_id();
     WPML_LogRotation::limitNumberOfMailsByAmount();
     // Assert oldest mail is gone.
     $this->assertFalse(Mail::find_one($oldest_mail_id));
 }