You are viewing a plain text version of this content. The canonical link for it is here.
Posted to zeta-commits@incubator.apache.org by je...@apache.org on 2011/08/04 08:21:14 UTC

[zeta-commits] svn commit: r1153777 - /incubator/zetacomponents/trunk/TemplateTranslationTiein/tests/extracter.php

Author: jeromer
Date: Thu Aug  4 08:21:14 2011
New Revision: 1153777

URL: http://svn.apache.org/viewvc?rev=1153777&view=rev
Log:
- Added runExtractorCommand()

# I apologize for the "No new line at end of line" message
# I tried to fix this in Vim but nothing seems to work ....


Modified:
    incubator/zetacomponents/trunk/TemplateTranslationTiein/tests/extracter.php

Modified: incubator/zetacomponents/trunk/TemplateTranslationTiein/tests/extracter.php
URL: http://svn.apache.org/viewvc/incubator/zetacomponents/trunk/TemplateTranslationTiein/tests/extracter.php?rev=1153777&r1=1153776&r2=1153777&view=diff
==============================================================================
--- incubator/zetacomponents/trunk/TemplateTranslationTiein/tests/extracter.php (original)
+++ incubator/zetacomponents/trunk/TemplateTranslationTiein/tests/extracter.php Thu Aug  4 08:21:14 2011
@@ -156,40 +156,46 @@ class ezcTemplateTranslationExtracterTes
 
     public function testRunNonEztTemplateExtension()
     {
-        $origArgv = $_SERVER['argv'];
         $tmpDir = sys_get_temp_dir();
         $testFileDir = "TemplateTranslationTiein/tests/test_files/extractor/templates/customtplextension";
         $tmpFile = "${tmpDir}/en.xml";
 
+        $this->runExtractorCommand( $testFileDir, 'tpl', $tmpDir );
+
+        $this->assertEquals(
+            file_get_contents( "${testFileDir}/output.xml" ),
+            file_get_contents( $tmpFile )
+        );
+
+        unlink( $tmpFile );
+    }
+
+    public static function suite()
+    {
+         return new PHPUnit_Framework_TestSuite( 'ezcTemplateTranslationExtracterTest' );
+    }
+
+    private function runExtractorCommand( $inputDir, $fileExt, $outputDir )
+    {
+        $origArgv = $_SERVER['argv'];
+
         ob_start();
         $extractor = new ezcTemplateTranslationExtractor();
 
         $_SERVER['argv'] = array (
             0 => 'TemplateTranslationTiein/src/runextractor.php',
             1 => '-t',
-            2 => $testFileDir,
+            2 => $inputDir,
             3 => '-e',
-            4 => 'tpl',
-            5 => $tmpDir,
+            4 => $fileExt,
+            5 => $outputDir,
         );
 
         $extractor->run();
         ob_end_clean();
 
         $_SERVER['argv'] = $origArgv;
-
-        $this->assertEquals(
-            file_get_contents( "${testFileDir}/output.xml" ),
-            file_get_contents( $tmpFile )
-        );
-
-        unlink( $tmpFile );
-    }
-
-    public static function suite()
-    {
-         return new PHPUnit_Framework_TestSuite( 'ezcTemplateTranslationExtracterTest' );
     }
 }
 
-?>
\ No newline at end of file
+?>



Re: [zeta-dev] Re: [zeta-commits] svn commit: r1153777 - /incubator/zetacomponents/trunk/TemplateTranslationTiein/tests/extracter.p hp

Posted by Jerome Renard <je...@gmail.com>.
Hi Derick,

On Thu, Aug 4, 2011 at 10:32 AM, Derick Rethans <de...@apache.org> wrote:
> On Thu, 4 Aug 2011, jeromer@apache.org wrote:
>
>> Author: jeromer
>> Date: Thu Aug  4 08:21:14 2011
>> New Revision: 1153777
>>
>> URL: http://svn.apache.org/viewvc?rev=1153777&view=rev
>> Log:
>> - Added runExtractorCommand()
>>
>> # I apologize for the "No new line at end of line" message
>> # I tried to fix this in Vim but nothing seems to work ....
>
> But there should be a new line at the end, so this patch fixes it!
>

Ho, you are right. I did not pay enough attention. I completely blocked
on the "No new line .." message.

> Please do not forgot to add new features to the NEWS file though.
>

The function is not a new feature this is just a wrapper in a test file so
I believe the NEWS file should not be updated, unless you really want me
to update it.

:)

-- 
Jérôme Renard
http://39web.fr | http://jrenard.info | http://twitter.com/jeromerenard

Re: [zeta-commits] svn commit: r1153777 - /incubator/zetacomponents/trunk/TemplateTranslationTiein/tests/extracter.p hp

Posted by Derick Rethans <de...@apache.org>.
On Thu, 4 Aug 2011, jeromer@apache.org wrote:

> Author: jeromer
> Date: Thu Aug  4 08:21:14 2011
> New Revision: 1153777
> 
> URL: http://svn.apache.org/viewvc?rev=1153777&view=rev
> Log:
> - Added runExtractorCommand()
> 
> # I apologize for the "No new line at end of line" message
> # I tried to fix this in Vim but nothing seems to work ....

But there should be a new line at the end, so this patch fixes it!

Please do not forgot to add new features to the NEWS file though.

cheers,
Derick

-- 
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug

[zeta-dev] Re: [zeta-commits] svn commit: r1153777 - /incubator/zetacomponents/trunk/TemplateTranslationTiein/tests/extracter.p hp

Posted by Derick Rethans <de...@apache.org>.
On Thu, 4 Aug 2011, jeromer@apache.org wrote:

> Author: jeromer
> Date: Thu Aug  4 08:21:14 2011
> New Revision: 1153777
> 
> URL: http://svn.apache.org/viewvc?rev=1153777&view=rev
> Log:
> - Added runExtractorCommand()
> 
> # I apologize for the "No new line at end of line" message
> # I tried to fix this in Vim but nothing seems to work ....

But there should be a new line at the end, so this patch fixes it!

Please do not forgot to add new features to the NEWS file though.

cheers,
Derick

-- 
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug