public function testContextsNested()
{
$file = "{$this->_path}/source/a.html.php";
$data = <<<EOD
<?=\$t('Robin, {:a}', array('a' => \$t('Michael, {:b}', array('b' => \$t('Bruce', array('context' => 'Lee')), 'context' => 'Jackson')), 'context' => 'Hood')); ?>
EOD;
file_put_contents($file, $data);
$configs = Catalog::config();
$configKey1 = key($configs);
next($configs);
$configKey2 = key($configs);
$this->_writeInput(array($configKey1, $configKey2, '', 'y'));
$result = $this->command->run();
$expected = 0;
$this->assertIdentical($expected, $result);
$expected = '/.*Yielded 3 item.*/';
$result = $this->command->response->output;
$this->assertPattern($expected, $result);
$file = "{$this->_path}/destination/message_default.pot";
$this->assertFileExists($file);
$result = file_get_contents($file);
$expected = '#/tmp/tests/source(/|\\\\)a.html.php:1';
$expected .= "\n";
$expected .= 'msgctxt "Hood"';
$expected .= "\n";
$expected .= 'msgid "Robin, {:a}"#';
$this->assertPattern($expected, $result);
$expected = '#/tmp/tests/source(/|\\\\)a.html.php:1';
$expected .= "\n";
$expected .= 'msgctxt "Jackson"';
$expected .= "\n";
$expected .= 'msgid "Michael, {:b}"#';
$this->assertPattern($expected, $result);
$expected = '#/tmp/tests/source(/|\\\\)a.html.php:1';
$expected .= "\n";
$expected .= 'msgctxt "Lee"';
$expected .= "\n";
$expected .= 'msgid "Bruce"#';
$this->assertPattern($expected, $result);
$result = $this->command->response->error;
$this->assertEmpty($result);
}