From a4c69b71108dac5c1f81646ebdbf07e9b95b888e Mon Sep 17 00:00:00 2001 From: Robert Boloc Date: Tue, 21 May 2013 19:17:13 +0200 Subject: [PATCH 1/6] moved include path restore to tearDown, reused stream_resolved_include_path result --- src/Translator/Loader/PhpArray.php | 6 +++--- test/Translator/Loader/PhpArrayTest.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Translator/Loader/PhpArray.php b/src/Translator/Loader/PhpArray.php index 9ac1f720..0ff8b41d 100644 --- a/src/Translator/Loader/PhpArray.php +++ b/src/Translator/Loader/PhpArray.php @@ -29,15 +29,15 @@ class PhpArray implements FileLoaderInterface */ public function load($locale, $filename) { - if (!stream_resolve_include_path($filename) && - (!is_file($filename) || !is_readable($filename))) { + $fromIncludePath = stream_resolve_include_path($filename); + if (!$fromIncludePath && (!is_file($filename) || !is_readable($filename))) { throw new Exception\InvalidArgumentException(sprintf( 'Could not open file %s for reading', $filename )); } - $messages = include $filename; + $messages = include ($fromIncludePath !== false) ? $fromIncludePath : $filename; if (!is_array($messages)) { throw new Exception\InvalidArgumentException(sprintf( diff --git a/test/Translator/Loader/PhpArrayTest.php b/test/Translator/Loader/PhpArrayTest.php index 7c639ddc..114d35ac 100644 --- a/test/Translator/Loader/PhpArrayTest.php +++ b/test/Translator/Loader/PhpArrayTest.php @@ -30,6 +30,9 @@ public function setUp() public function tearDown() { Locale::setDefault($this->originalLocale); + + // Restore original include path + restore_include_path(); } public function testLoaderFailsToLoadMissingFile() @@ -84,8 +87,5 @@ public function testLoaderLoadsFromIncludePath() $this->assertEquals('Message 1 (en)', $textDomain['Message 1']); $this->assertEquals('Message 4 (en)', $textDomain['Message 4']); - - // Restore original include path - restore_include_path(); } } From 9182e7db43c31df7a53ee4812a9de0a128d893f3 Mon Sep 17 00:00:00 2001 From: Robert Boloc Date: Tue, 21 May 2013 22:11:22 +0200 Subject: [PATCH 2/6] backup original include path on setUp and restore on tearDown, unified loading --- src/Translator/Loader/PhpArray.php | 7 +++---- test/Translator/Loader/PhpArrayTest.php | 12 ++++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Translator/Loader/PhpArray.php b/src/Translator/Loader/PhpArray.php index 0ff8b41d..52b3f3ff 100644 --- a/src/Translator/Loader/PhpArray.php +++ b/src/Translator/Loader/PhpArray.php @@ -30,14 +30,13 @@ class PhpArray implements FileLoaderInterface public function load($locale, $filename) { $fromIncludePath = stream_resolve_include_path($filename); - if (!$fromIncludePath && (!is_file($filename) || !is_readable($filename))) { + if (!$fromIncludePath || !is_file($fromIncludePath) || !is_readable($fromIncludePath)) { throw new Exception\InvalidArgumentException(sprintf( - 'Could not open file %s for reading', - $filename + 'Could not find or open file %s for reading', $filename )); } - $messages = include ($fromIncludePath !== false) ? $fromIncludePath : $filename; + $messages = include $fromIncludePath; if (!is_array($messages)) { throw new Exception\InvalidArgumentException(sprintf( diff --git a/test/Translator/Loader/PhpArrayTest.php b/test/Translator/Loader/PhpArrayTest.php index 114d35ac..b0033e69 100644 --- a/test/Translator/Loader/PhpArrayTest.php +++ b/test/Translator/Loader/PhpArrayTest.php @@ -18,6 +18,7 @@ class PhpArrayTest extends TestCase { protected $testFilesDir; protected $originalLocale; + protected $originalIncludePath; public function setUp() { @@ -25,20 +26,22 @@ public function setUp() Locale::setDefault('en_EN'); $this->testFilesDir = realpath(__DIR__ . '/../_files'); + + $this->originalIncludePath = get_include_path(); + set_include_path($this->testFilesDir); } public function tearDown() { Locale::setDefault($this->originalLocale); - // Restore original include path - restore_include_path(); + set_include_path($this->originalIncludePath); } public function testLoaderFailsToLoadMissingFile() { $loader = new PhpArrayLoader(); - $this->setExpectedException('Zend\I18n\Exception\InvalidArgumentException', 'Could not open file'); + $this->setExpectedException('Zend\I18n\Exception\InvalidArgumentException', 'Could not find or open file'); $loader->load('en_EN', 'missing'); } @@ -79,9 +82,6 @@ public function testLoaderLoadsPluralRules() public function testLoaderLoadsFromIncludePath() { - // Set test include path - set_include_path($this->testFilesDir); - $loader = new PhpArrayLoader(); $textDomain = $loader->load('en_EN', 'translation_en.php'); From 16fe38f79b32552b0fb278b80e76ade442c94166 Mon Sep 17 00:00:00 2001 From: Robert Boloc Date: Fri, 24 May 2013 09:05:49 +0200 Subject: [PATCH 3/6] added loading from include path feature to all translator loaders --- src/Translator/Loader/Gettext.php | 7 ++++--- src/Translator/Loader/Ini.php | 7 ++++--- src/Translator/Loader/PhpArray.php | 3 ++- test/Translator/Loader/GettextTest.php | 17 ++++++++++++++++- test/Translator/Loader/IniTest.php | 20 +++++++++++++++++++- 5 files changed, 45 insertions(+), 9 deletions(-) diff --git a/src/Translator/Loader/Gettext.php b/src/Translator/Loader/Gettext.php index ca156526..91950b1b 100644 --- a/src/Translator/Loader/Gettext.php +++ b/src/Translator/Loader/Gettext.php @@ -44,9 +44,10 @@ class Gettext implements FileLoaderInterface */ public function load($locale, $filename) { - if (!is_file($filename) || !is_readable($filename)) { + $fromIncludePath = stream_resolve_include_path($filename); + if (!$fromIncludePath || !is_file($fromIncludePath) || !is_readable($fromIncludePath)) { throw new Exception\InvalidArgumentException(sprintf( - 'Could not open file %s for reading', + 'Could not find or open file %s for reading', $filename )); } @@ -54,7 +55,7 @@ public function load($locale, $filename) $textDomain = new TextDomain(); ErrorHandler::start(); - $this->file = fopen($filename, 'rb'); + $this->file = fopen($fromIncludePath, 'rb'); $error = ErrorHandler::stop(); if (false === $this->file) { throw new Exception\InvalidArgumentException(sprintf( diff --git a/src/Translator/Loader/Ini.php b/src/Translator/Loader/Ini.php index 02a9ecac..037abb34 100644 --- a/src/Translator/Loader/Ini.php +++ b/src/Translator/Loader/Ini.php @@ -30,16 +30,17 @@ class Ini implements FileLoaderInterface */ public function load($locale, $filename) { - if (!is_file($filename) || !is_readable($filename)) { + $fromIncludePath = stream_resolve_include_path($filename); + if (!$fromIncludePath || !is_file($fromIncludePath) || !is_readable($fromIncludePath)) { throw new Exception\InvalidArgumentException(sprintf( - 'Could not open file %s for reading', + 'Could not find or open file %s for reading', $filename )); } $messages = array(); $iniReader = new IniReader(); - $messagesNamespaced = $iniReader->fromFile($filename); + $messagesNamespaced = $iniReader->fromFile($fromIncludePath); $list = $messagesNamespaced; if (isset($messagesNamespaced['translation'])) { diff --git a/src/Translator/Loader/PhpArray.php b/src/Translator/Loader/PhpArray.php index 52b3f3ff..137f035a 100644 --- a/src/Translator/Loader/PhpArray.php +++ b/src/Translator/Loader/PhpArray.php @@ -32,7 +32,8 @@ public function load($locale, $filename) $fromIncludePath = stream_resolve_include_path($filename); if (!$fromIncludePath || !is_file($fromIncludePath) || !is_readable($fromIncludePath)) { throw new Exception\InvalidArgumentException(sprintf( - 'Could not find or open file %s for reading', $filename + 'Could not find or open file %s for reading', + $filename )); } diff --git a/test/Translator/Loader/GettextTest.php b/test/Translator/Loader/GettextTest.php index d1c4c57c..5069d3b2 100644 --- a/test/Translator/Loader/GettextTest.php +++ b/test/Translator/Loader/GettextTest.php @@ -18,6 +18,7 @@ class GettextTest extends TestCase { protected $testFilesDir; protected $originalLocale; + protected $originalIncludePath; public function setUp() { @@ -25,17 +26,22 @@ public function setUp() Locale::setDefault('en_EN'); $this->testFilesDir = realpath(__DIR__ . '/../_files'); + + $this->originalIncludePath = get_include_path(); + set_include_path($this->testFilesDir); } public function tearDown() { Locale::setDefault($this->originalLocale); + + set_include_path($this->originalIncludePath); } public function testLoaderFailsToLoadMissingFile() { $loader = new GettextLoader(); - $this->setExpectedException('Zend\I18n\Exception\InvalidArgumentException', 'Could not open file'); + $this->setExpectedException('Zend\I18n\Exception\InvalidArgumentException', 'Could not find or open file'); $loader->load('en_EN', 'missing'); } @@ -80,4 +86,13 @@ public function testLoaderLoadsPluralRules() $this->assertEquals(1, $textDomain->getPluralRule()->evaluate(2)); $this->assertEquals(2, $textDomain->getPluralRule()->evaluate(10)); } + + public function testLoaderLoadsFromIncludePath() + { + $loader = new GettextLoader(); + $textDomain = $loader->load('en_EN', 'translation_en.mo'); + + $this->assertEquals('Message 1 (en)', $textDomain['Message 1']); + $this->assertEquals('Message 4 (en)', $textDomain['Message 4']); + } } diff --git a/test/Translator/Loader/IniTest.php b/test/Translator/Loader/IniTest.php index 3d7eee63..a88b76c4 100644 --- a/test/Translator/Loader/IniTest.php +++ b/test/Translator/Loader/IniTest.php @@ -18,16 +18,25 @@ class IniTest extends TestCase { protected $testFilesDir; protected $originalLocale; + protected $originalIncludePath; public function setUp() { $this->testFilesDir = realpath(__DIR__ . '/../_files'); + + $this->originalIncludePath = get_include_path(); + set_include_path($this->testFilesDir); + } + + public function tearDown() + { + set_include_path($this->originalIncludePath); } public function testLoaderFailsToLoadMissingFile() { $loader = new IniLoader(); - $this->setExpectedException('Zend\I18n\Exception\InvalidArgumentException', 'Could not open file'); + $this->setExpectedException('Zend\I18n\Exception\InvalidArgumentException', 'Could not find or open file'); $loader->load('en_EN', 'missing'); } @@ -91,4 +100,13 @@ public function testLoaderLoadsPluralRules() $this->assertEquals(1, $textDomain->getPluralRule()->evaluate(2)); $this->assertEquals(2, $textDomain->getPluralRule()->evaluate(10)); } + + public function testLoaderLoadsFromIncludePath() + { + $loader = new IniLoader(); + $textDomain = $loader->load('en_EN', 'translation_en.ini'); + + $this->assertEquals('Message 1 (en)', $textDomain['Message 1']); + $this->assertEquals('Message 4 (en)', $textDomain['Message 4']); + } } From 513999a0f0c795903dab63111a87ee5414fe129b Mon Sep 17 00:00:00 2001 From: Robert Boloc Date: Mon, 3 Jun 2013 15:32:21 +0200 Subject: [PATCH 4/6] fixed loading from phar --- src/Translator/Loader/Gettext.php | 3 ++- src/Translator/Loader/Ini.php | 3 ++- src/Translator/Loader/PhpArray.php | 3 ++- test/Translator/Loader/GettextTest.php | 11 ++++++++++- test/Translator/Loader/IniTest.php | 11 ++++++++++- test/Translator/Loader/PhpArrayTest.php | 11 ++++++++++- test/Translator/_files/phparray.phar | Bin 0 -> 7795 bytes test/Translator/_files/translations.phar | Bin 0 -> 9664 bytes 8 files changed, 36 insertions(+), 6 deletions(-) create mode 100755 test/Translator/_files/phparray.phar create mode 100644 test/Translator/_files/translations.phar diff --git a/src/Translator/Loader/Gettext.php b/src/Translator/Loader/Gettext.php index 91950b1b..87dd2593 100644 --- a/src/Translator/Loader/Gettext.php +++ b/src/Translator/Loader/Gettext.php @@ -44,7 +44,8 @@ class Gettext implements FileLoaderInterface */ public function load($locale, $filename) { - $fromIncludePath = stream_resolve_include_path($filename); + $resolvedIncludePath = stream_resolve_include_path($filename); + $fromIncludePath = ($resolvedIncludePath !== false) ? $resolvedIncludePath : $filename; if (!$fromIncludePath || !is_file($fromIncludePath) || !is_readable($fromIncludePath)) { throw new Exception\InvalidArgumentException(sprintf( 'Could not find or open file %s for reading', diff --git a/src/Translator/Loader/Ini.php b/src/Translator/Loader/Ini.php index 037abb34..b81ebbf3 100644 --- a/src/Translator/Loader/Ini.php +++ b/src/Translator/Loader/Ini.php @@ -30,7 +30,8 @@ class Ini implements FileLoaderInterface */ public function load($locale, $filename) { - $fromIncludePath = stream_resolve_include_path($filename); + $resolvedIncludePath = stream_resolve_include_path($filename); + $fromIncludePath = ($resolvedIncludePath !== false) ? $resolvedIncludePath : $filename; if (!$fromIncludePath || !is_file($fromIncludePath) || !is_readable($fromIncludePath)) { throw new Exception\InvalidArgumentException(sprintf( 'Could not find or open file %s for reading', diff --git a/src/Translator/Loader/PhpArray.php b/src/Translator/Loader/PhpArray.php index 137f035a..accdcb0e 100644 --- a/src/Translator/Loader/PhpArray.php +++ b/src/Translator/Loader/PhpArray.php @@ -29,7 +29,8 @@ class PhpArray implements FileLoaderInterface */ public function load($locale, $filename) { - $fromIncludePath = stream_resolve_include_path($filename); + $resolvedIncludePath = stream_resolve_include_path($filename); + $fromIncludePath = ($resolvedIncludePath !== false) ? $resolvedIncludePath : $filename; if (!$fromIncludePath || !is_file($fromIncludePath) || !is_readable($fromIncludePath)) { throw new Exception\InvalidArgumentException(sprintf( 'Could not find or open file %s for reading', diff --git a/test/Translator/Loader/GettextTest.php b/test/Translator/Loader/GettextTest.php index 5069d3b2..d3c7f60f 100644 --- a/test/Translator/Loader/GettextTest.php +++ b/test/Translator/Loader/GettextTest.php @@ -28,7 +28,7 @@ public function setUp() $this->testFilesDir = realpath(__DIR__ . '/../_files'); $this->originalIncludePath = get_include_path(); - set_include_path($this->testFilesDir); + set_include_path($this->testFilesDir.PATH_SEPARATOR.$this->testFilesDir.'/translations.phar'); } public function tearDown() @@ -95,4 +95,13 @@ public function testLoaderLoadsFromIncludePath() $this->assertEquals('Message 1 (en)', $textDomain['Message 1']); $this->assertEquals('Message 4 (en)', $textDomain['Message 4']); } + + public function testLoaderLoadsFromPhar() + { + $loader = new GettextLoader(); + $textDomain = $loader->load('en_EN', 'phar://'.$this->testFilesDir.'/translations.phar/translation_en.mo'); + + $this->assertEquals('Message 1 (en)', $textDomain['Message 1']); + $this->assertEquals('Message 4 (en)', $textDomain['Message 4']); + } } diff --git a/test/Translator/Loader/IniTest.php b/test/Translator/Loader/IniTest.php index a88b76c4..f7dad78d 100644 --- a/test/Translator/Loader/IniTest.php +++ b/test/Translator/Loader/IniTest.php @@ -25,7 +25,7 @@ public function setUp() $this->testFilesDir = realpath(__DIR__ . '/../_files'); $this->originalIncludePath = get_include_path(); - set_include_path($this->testFilesDir); + set_include_path($this->testFilesDir.PATH_SEPARATOR.$this->testFilesDir.'/translations.phar'); } public function tearDown() @@ -109,4 +109,13 @@ public function testLoaderLoadsFromIncludePath() $this->assertEquals('Message 1 (en)', $textDomain['Message 1']); $this->assertEquals('Message 4 (en)', $textDomain['Message 4']); } + + public function testLoaderLoadsFromPhar() + { + $loader = new IniLoader(); + $textDomain = $loader->load('en_EN', 'phar://'.$this->testFilesDir.'/translations.phar/translation_en.ini'); + + $this->assertEquals('Message 1 (en)', $textDomain['Message 1']); + $this->assertEquals('Message 4 (en)', $textDomain['Message 4']); + } } diff --git a/test/Translator/Loader/PhpArrayTest.php b/test/Translator/Loader/PhpArrayTest.php index b0033e69..d248d145 100644 --- a/test/Translator/Loader/PhpArrayTest.php +++ b/test/Translator/Loader/PhpArrayTest.php @@ -28,7 +28,7 @@ public function setUp() $this->testFilesDir = realpath(__DIR__ . '/../_files'); $this->originalIncludePath = get_include_path(); - set_include_path($this->testFilesDir); + set_include_path($this->testFilesDir.PATH_SEPARATOR.$this->testFilesDir.'/translations.phar'); } public function tearDown() @@ -88,4 +88,13 @@ public function testLoaderLoadsFromIncludePath() $this->assertEquals('Message 1 (en)', $textDomain['Message 1']); $this->assertEquals('Message 4 (en)', $textDomain['Message 4']); } + + public function testLoaderLoadsFromPhar() + { + $loader = new PhpArrayLoader(); + $textDomain = $loader->load('en_EN', 'phar://'.$this->testFilesDir.'/translations.phar/translation_en.php'); + + $this->assertEquals('Message 1 (en)', $textDomain['Message 1']); + $this->assertEquals('Message 4 (en)', $textDomain['Message 4']); + } } diff --git a/test/Translator/_files/phparray.phar b/test/Translator/_files/phparray.phar new file mode 100755 index 0000000000000000000000000000000000000000..e4036a0342b0acbb269cf597b636ffdd7937398a GIT binary patch literal 7795 zcmb_h&2t+`6%TMiRUF{Jx#OD6jAF|p$xgD^mSe|p64%;^*4BE9m@tfHTGFiNiBf&@yHrw_drrEO}~EM{rbJv-CIx7N!n-_ zmwd>2%q%iD&O^5dlGrJDUf4nG^Q%?hn4678Fk)5^J8qV_*Or-1+{|2Id6989a>l%H zE;Bbxd6rwvCVTLJd7+!<4!;WWBDc)GL~mp6^9BtzHiEd|na9)OMG*2A)7S&$W+Mlu zAojwk&z;mQCQ{OdZJTVBInIlN!+poWXMcC_$~oEZ?;h_C-W&r!D$Ecz!A(kndGuk$ z(=c3NWG$u?E)$l_^EZXS{VVvyD;&w^WUzZY*lc9Hm}c>2<4ft29V^J8wPiq^ZnQq>JE0Ng2Vc>}jU|+R9b1&T7%Yw8ZmQmm<_qbC(NNh2daLMuxI8nY= zUfn*a z(-6@7vW6m`B;NU@d%;^HrYE(RUlA~zmJ@rCV5RZ68Q`XR8xu^<4yb^vt~1mQSc}wb~2HR zlv~Z4Mp{6Dd^&`v#d5yA9&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jQsg9q!8p>YKpL}K zP293+?qh3SaUh}V&%mqa@NhbfyVU9Y8m7=++iGI{NF|C(uwb}imqef7qA8HJ}>jc ziv2a7ujBb69?HvqRqs#K``_yQA~OBA@clC0ALFs`d=u?|d|__x6}(?SMkYS5s`sLL zH`RL=?|bNf8*h-#flO2#FW?Q(+?Vjs@5}Nf8+TgLwGe(O^HdZlLQ zOR({avUTRrK{Zb|M`_QxafwG`_jqiz0w;8lpPKAO*GmnVKCQb{RiQ|dQR;tOQ^6WR ze}rgiwehb=F!$TmLC9S%wT?t;*pV7EnN(rSE5!PloA4b8&OD~rl%Xs04jH7frVK|} vb1cZrfM5D#5x+6lI{f{oM=$OF Date: Mon, 3 Jun 2013 15:34:31 +0200 Subject: [PATCH 5/6] removed unnecessary test file --- test/Translator/_files/phparray.phar | Bin 7795 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100755 test/Translator/_files/phparray.phar diff --git a/test/Translator/_files/phparray.phar b/test/Translator/_files/phparray.phar deleted file mode 100755 index e4036a0342b0acbb269cf597b636ffdd7937398a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7795 zcmb_h&2t+`6%TMiRUF{Jx#OD6jAF|p$xgD^mSe|p64%;^*4BE9m@tfHTGFiNiBf&@yHrw_drrEO}~EM{rbJv-CIx7N!n-_ zmwd>2%q%iD&O^5dlGrJDUf4nG^Q%?hn4678Fk)5^J8qV_*Or-1+{|2Id6989a>l%H zE;Bbxd6rwvCVTLJd7+!<4!;WWBDc)GL~mp6^9BtzHiEd|na9)OMG*2A)7S&$W+Mlu zAojwk&z;mQCQ{OdZJTVBInIlN!+poWXMcC_$~oEZ?;h_C-W&r!D$Ecz!A(kndGuk$ z(=c3NWG$u?E)$l_^EZXS{VVvyD;&w^WUzZY*lc9Hm}c>2<4ft29V^J8wPiq^ZnQq>JE0Ng2Vc>}jU|+R9b1&T7%Yw8ZmQmm<_qbC(NNh2daLMuxI8nY= zUfn*a z(-6@7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R=$TDN(KW=ieKrSHSK z<7qGC$Ob5iqN^|Wk)sWP_$ybU@E{h5` zS`$l62#=twjZ$HyH;EEdw0R#u^5e&kNwWCgkOzd>;88VKWI1(4kaE=(3z5#%YMo|K zpl`E-)qmA@-ke}rKRtMj-u^Z*z+_QCFWgLqJdZCdb8yrL)>8_w%6Q{;yiW+Em}(0Q z(3361OXUF5Cab{)c|q>@LK7K`5uoWh{5_AI4WC2n~V~O6SLfu)%`O65=r$7~hu9X&WC>c-*M~`P9 z<}>P01cMw50E3aDfJ+qGr?f}K2<08kkKC}p#n>BTB($4pAPL)&p!3-Q*NK) z@}N8cS44KP5adSThFQ*MYs5THGu)hxEc1gYHJSBzjR$C?N9x}qc29_%kw93&$gnzA zU0M>kOhD<1g{s4QG_!PHEa0~OuI$FBi?8em5?&j}b%_XxKD(Bgh+-QzAC#l1i#9wm zNz9*->J8P=8lFfsbQbff{j(rNjoqpC#vVD07$HQ<>Xr{n5r%v~10n4q|a*#KaYR?1r)* zWmF;1b>ZO4I5odGr>~X=56Ny7FtEgg2#ewjK?GQnZkJ{aN3a4>N9)oDQyl)i%vdlQ7cJBxM zF8+Rqzwh8r{`(Prst-pzrU#>6fA8MCU-f_gG5vb~{lj0rQUu=zc6mg9i~%9h@4tWi zw|{D+E%7X6KYZ9=57}ED`|L%A8?MVFJ7?CUC{jGvj5K8R1_-M-5!p?k6U7dB8QB^C z6!JJICexunBJ7gZz8Q7J`K*|5=DBea)m-E*j?9`cGQE}JU=0ZhYb z=7tVJK2om%u>|G4wM`~Jdsh5Gr`_vyC|2pSeZSY~Akf>0ZyIm+x_WA>w@#meqP^8= zQ@12YfYYYU(E&}jxoJ`*Wz7}wV;~8g?Kq+7LS{_78j~&Xm=K=TZ^O~6*SFS zEz Date: Mon, 3 Jun 2013 15:47:28 +0200 Subject: [PATCH 6/6] CS fixes --- test/Translator/Loader/GettextTest.php | 4 ++-- test/Translator/Loader/IniTest.php | 4 ++-- test/Translator/Loader/PhpArrayTest.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/Translator/Loader/GettextTest.php b/test/Translator/Loader/GettextTest.php index d3c7f60f..703f5c84 100644 --- a/test/Translator/Loader/GettextTest.php +++ b/test/Translator/Loader/GettextTest.php @@ -28,7 +28,7 @@ public function setUp() $this->testFilesDir = realpath(__DIR__ . '/../_files'); $this->originalIncludePath = get_include_path(); - set_include_path($this->testFilesDir.PATH_SEPARATOR.$this->testFilesDir.'/translations.phar'); + set_include_path($this->testFilesDir . PATH_SEPARATOR . $this->testFilesDir . '/translations.phar'); } public function tearDown() @@ -99,7 +99,7 @@ public function testLoaderLoadsFromIncludePath() public function testLoaderLoadsFromPhar() { $loader = new GettextLoader(); - $textDomain = $loader->load('en_EN', 'phar://'.$this->testFilesDir.'/translations.phar/translation_en.mo'); + $textDomain = $loader->load('en_EN', 'phar://' . $this->testFilesDir . '/translations.phar/translation_en.mo'); $this->assertEquals('Message 1 (en)', $textDomain['Message 1']); $this->assertEquals('Message 4 (en)', $textDomain['Message 4']); diff --git a/test/Translator/Loader/IniTest.php b/test/Translator/Loader/IniTest.php index f7dad78d..650c9555 100644 --- a/test/Translator/Loader/IniTest.php +++ b/test/Translator/Loader/IniTest.php @@ -25,7 +25,7 @@ public function setUp() $this->testFilesDir = realpath(__DIR__ . '/../_files'); $this->originalIncludePath = get_include_path(); - set_include_path($this->testFilesDir.PATH_SEPARATOR.$this->testFilesDir.'/translations.phar'); + set_include_path($this->testFilesDir . PATH_SEPARATOR . $this->testFilesDir . '/translations.phar'); } public function tearDown() @@ -113,7 +113,7 @@ public function testLoaderLoadsFromIncludePath() public function testLoaderLoadsFromPhar() { $loader = new IniLoader(); - $textDomain = $loader->load('en_EN', 'phar://'.$this->testFilesDir.'/translations.phar/translation_en.ini'); + $textDomain = $loader->load('en_EN', 'phar://' . $this->testFilesDir . '/translations.phar/translation_en.ini'); $this->assertEquals('Message 1 (en)', $textDomain['Message 1']); $this->assertEquals('Message 4 (en)', $textDomain['Message 4']); diff --git a/test/Translator/Loader/PhpArrayTest.php b/test/Translator/Loader/PhpArrayTest.php index d248d145..be764153 100644 --- a/test/Translator/Loader/PhpArrayTest.php +++ b/test/Translator/Loader/PhpArrayTest.php @@ -28,7 +28,7 @@ public function setUp() $this->testFilesDir = realpath(__DIR__ . '/../_files'); $this->originalIncludePath = get_include_path(); - set_include_path($this->testFilesDir.PATH_SEPARATOR.$this->testFilesDir.'/translations.phar'); + set_include_path($this->testFilesDir . PATH_SEPARATOR . $this->testFilesDir . '/translations.phar'); } public function tearDown() @@ -92,7 +92,7 @@ public function testLoaderLoadsFromIncludePath() public function testLoaderLoadsFromPhar() { $loader = new PhpArrayLoader(); - $textDomain = $loader->load('en_EN', 'phar://'.$this->testFilesDir.'/translations.phar/translation_en.php'); + $textDomain = $loader->load('en_EN', 'phar://' . $this->testFilesDir . '/translations.phar/translation_en.php'); $this->assertEquals('Message 1 (en)', $textDomain['Message 1']); $this->assertEquals('Message 4 (en)', $textDomain['Message 4']);