public function testContextsWithMultipleOccurences() { $file = "{$this->_path}/source/a.html.php"; $data = <<<EOD <h2>Balls</h2> <?=\$t('Ball', array('context' => 'Spherical object')); ?> <?=\$t('Ball', array('context' => 'Social gathering')); ?> <?=\$t('Ball'); ?> <?=\$t('Ball', array('context' => 'Social gathering')); ?> 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:3'; $expected .= "\n"; $expected .= '.*/tmp/tests/source(/|\\\\)a.html.php:5'; $expected .= "\n"; $expected .= 'msgctxt "Social gathering"'; $expected .= "\n"; $expected .= 'msgid "Ball"#'; $this->assertPattern($expected, $result); $result = $this->command->response->error; $this->assertEmpty($result); }