<commit_before><?php

include dirname(__FILE__).'/../../bootstrap/unit.php';

$t = new sfTaskExtraLimeTest(3);
$t->setProjectConfiguration($configuration);

// lets create the extractor object
$culture = 'fr';
$i18n = $t->getI18n($culture, 'frontend');

$extractor = new sfI18nFormExtract($i18n, $culture, array('form' => 'FooI18nForm'));
$extractor->extract();


// begin: tests

$t->messages_ok(
  $extractor->getAllSeenMessages(),
  array(
    'Required.',    // validator
    'Invalid.',
    'Title',        // widget label
    'Try to fill this field ...',
    '"%value%" is too long (%max_length% characters max).',
    '"%value%" is too short (%min_length% characters min).',
    'CSRF attack detected.',
    'Content',
    ' csrf token',
    'Oh! this validator is a very dumb one', // post validator
  ),
  '->getAllSeenMessages() returns %msg_total% messages.'
);
$t->messages_ok(
  $extractor->getCurrentMessages(),
  array(
    'Title',
    'Required.',
    'Set in "fooComponent" component',

    // from the i18n dir (deleted messages)
    'This message does not exist anymore',
  ),
  '->getCurrentMessages() returns %msg_total% messages.'
);
$t->messages_ok(
  $extractor->getOldMessages(),
  array(
    'Set in "fooComponent" component',
    'This message does not exist anymore',
  ),
  '->getOldMessages() returns nothing.'
);<commit_msg>Fix: i18n Form extractor tests<commit_after><?php

include dirname(__FILE__).'/../../bootstrap/unit.php';

$t = new sfTaskExtraLimeTest(3);
$t->setProjectConfiguration($configuration);

// lets create the extractor object
$culture = 'fr';
$i18n = $t->getI18n($culture, 'frontend');

$extractor = new sfI18nFormExtract($i18n, $culture, array('form' => 'FooI18nForm'));
$extractor->extract();


// begin: tests

$t->messages_ok(
  $extractor->getAllSeenMessages(),
  array(
    'Required.',    // validator
    'Invalid.',
    'Title',        // widget label
    'Try to fill this field ...',
    '"%value%" is too long (%max_length% characters max).',
    '"%value%" is too short (%min_length% characters min).',
    'CSRF attack detected.',
    'Content',
    ' csrf token',
    'Oh! this validator is a very dumb one', // post validator
  ),
  '->getAllSeenMessages() returns %msg_total% messages.'
);
$t->messages_ok(
  $extractor->getCurrentMessages(),
  array(
    'Title',
    'Required.',
    'Set in "fooComponent" component',

    // from the i18n dir (deleted messages)
    'This message does not exist anymore',
    'Deleted message',
  ),
  '->getCurrentMessages() returns %msg_total% messages.'
);
$t->messages_ok(
  $extractor->getOldMessages(),
  array(
    'Deleted message',
    'Set in "fooComponent" component',
    'This message does not exist anymore',
  ),
  '->getOldMessages() returns nothing.'
);
{'fraction_non_alphanumeric': 0.17176809506661866, 'fraction_numerical': 0.010082823190493338, 'mean_word_length': 3.66890756302521, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7378824', 'n_tokens_mistral': 916, 'n_tokens_neox': 898, 'n_words': 238}