Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
ZurmoGettextPoFileTest.php
1 <?php
2  /*********************************************************************************
3  * Zurmo is a customer relationship management program developed by
4  * Zurmo, Inc. Copyright (C) 2017 Zurmo Inc.
5  *
6  * Zurmo is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License version 3 as published by the
8  * Free Software Foundation with the addition of the following permission added
9  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10  * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
11  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
12  *
13  * Zurmo is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Affero General Public License along with
19  * this program; if not, see http://www.gnu.org/licenses or write to the Free
20  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  * 02110-1301 USA.
22  *
23  * You can contact Zurmo, Inc. with a mailing address at 27 North Wacker Drive
24  * Suite 370 Chicago, IL 60606. or at email address contact@zurmo.com.
25  *
26  * The interactive user interfaces in original and modified versions
27  * of this program must display Appropriate Legal Notices, as required under
28  * Section 5 of the GNU Affero General Public License version 3.
29  *
30  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31  * these Appropriate Legal Notices must retain the display of the Zurmo
32  * logo and Zurmo copyright notice. If the display of the logo is not reasonably
33  * feasible for technical reasons, the Appropriate Legal Notices must display the words
34  * "Copyright Zurmo Inc. 2017. All rights reserved".
35  ********************************************************************************/
36 
41  {
42  protected static $poFileName = 'messages-test.po';
43 
44  protected static $compareArray = array(
45  array(
46  'msgctxt' => 'TestCategory1',
47  'msgid' => 'PO file Testmessage. Category: 1. Type: source 1',
48  'msgstr' => 'PO file Testmessage. Category: 1. Type: translation 1'
49  ),
50  array(
51  'msgctxt' => 'TestCategory1',
52  'msgid' => 'PO file Testmessage. Category: 1. Type: source 2',
53  'msgstr' => 'PO file Testmessage. Category: 1. Type: translation 2'
54  ),
55  array(
56  'msgctxt' => 'TestCategory1',
57  'msgid' => 'PO file Testmessage. Category: 1. Type: source 3',
58  'msgstr' => 'PO file Testmessage. Category: 1. Type: translation 3'
59  ),
60  array(
61  'msgctxt' => 'TestCategory1',
62  'msgid' => 'PO file Testmessage. Category: 1. Type: source 4',
63  'msgstr' => 'PO file Testmessage. Category: 1. Type: translation 4'
64  ),
65  array(
66  'msgctxt' => 'TestCategory1',
67  'msgid' => 'PO file Testmessage. Category: 1. Type: source 5',
68  'msgstr' => 'PO file Testmessage. Category: 1. Type: translation 5'
69  ),
70  array(
71  'msgctxt' => 'TestCategory2',
72  'msgid' => 'PO file Testmessage. Category: 2. Type: source 1',
73  'msgstr' => 'PO file Testmessage. Category: 2. Type: translation 1'
74  ),
75  array(
76  'msgctxt' => 'TestCategory2',
77  'msgid' => 'PO file Testmessage. Category: 2. Type: source 2',
78  'msgstr' => 'PO file Testmessage. Category: 2. Type: translation 2'
79  ),
80  array(
81  'msgctxt' => 'TestCategory2',
82  'msgid' => 'PO file Testmessage. Category: 2. Type: source 3',
83  'msgstr' => 'PO file Testmessage. Category: 2. Type: translation 3'
84  ),
85  array(
86  'msgctxt' => 'TestCategory2',
87  'msgid' => 'PO file Testmessage. Category: 2. Type: source 4',
88  'msgstr' => 'PO file Testmessage. Category: 2. Type: translation 4'
89  ),
90  array(
91  'msgctxt' => 'TestCategory2',
92  'msgid' => 'PO file Testmessage. Category: 2. Type: source 5',
93  'msgstr' => 'PO file Testmessage. Category: 2. Type: translation 5'
94  ),
95  array(
96  'msgctxt' => 'TestCategory3',
97  'msgid' => 'PO file Testmessage. Category: 3. Type: source 1',
98  'msgstr' => 'PO file Testmessage. Category: 3. Type: translation 1'
99  ),
100  array(
101  'msgctxt' => 'TestCategory3',
102  'msgid' => 'PO file Testmessage. Category: 3. Type: source 2',
103  'msgstr' => 'PO file Testmessage. Category: 3. Type: translation 2'
104  ),
105  array(
106  'msgctxt' => 'TestCategory3',
107  'msgid' => 'PO file Testmessage. Category: 3. Type: source 3',
108  'msgstr' => 'PO file Testmessage. Category: 3. Type: translation 3'
109  ),
110  array(
111  'msgctxt' => 'TestCategory3',
112  'msgid' => 'PO file Testmessage. Category: 3. Type: source 4',
113  'msgstr' => 'PO file Testmessage. Category: 3. Type: translation 4'
114  ),
115  array(
116  'msgctxt' => 'TestCategory3',
117  'msgid' => 'PO file Testmessage. Category: 3. Type: source 5',
118  'msgstr' => 'PO file Testmessage. Category: 3. Type: translation 5'
119  )
120  );
121 
122  protected static function getFilePath($fileName)
123  {
124  $pathToFiles = Yii::getPathOfAlias('application.tests.unit.files');
125 
126  return $pathToFiles . DIRECTORY_SEPARATOR . $fileName;
127  }
128 
129  protected static function getCompareArray()
130  {
131  $array = self::$compareArray;
132 
133  return $array;
134  }
135 
136  public function testRead()
137  {
138  $filePath = self::getFilePath(self::$poFileName);
139  $compareArray = self::getCompareArray();
140 
141  $poFile = new ZurmoGettextPoFile($filePath);
142  $contextArray = $poFile->read();
143  $this->assertEquals(
144  md5(json_encode($compareArray)),
145  md5(json_encode($contextArray))
146  );
147  }
148  }
149 ?>
Generated on Sun Jul 12 2020 07:10:28
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.