This repository was archived by the owner on Sep 10, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55## dev-master
66
7+ ## 1.3.0 - 2017-04-05
8+
9+ * Implemented end-point ` /v1/fonts/list ` .
10+
711## 1.2.0 - 2017-02-25
812
913* Updated ` zendframework/zend-servicemanager ` to ` ^3.2 ` .
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ include_once 'bootstrap.php ' ;
4+
5+ use TxTextControl \ReportingCloud \Console \Helper ;
6+ use TxTextControl \ReportingCloud \ReportingCloud ;
7+
8+ $ reportingCloud = new ReportingCloud ([
9+ 'username ' => Helper::username (),
10+ 'password ' => Helper::password (),
11+ ]);
12+
13+ // ---------------------------------------------------------------------------------------------------------------------
14+
15+ var_dump ($ reportingCloud ->getFontList ());
16+
17+ // ---------------------------------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -182,6 +182,24 @@ public function templateExists($templateName)
182182 return (boolean ) $ this ->get ('/templates/exists ' , $ query );
183183 }
184184
185+ /**
186+ * Return an array of available fonts on the Reporting Cloud service
187+ *
188+ * @return array|null
189+ */
190+ public function getFontList ()
191+ {
192+ $ ret = null ;
193+
194+ $ fonts = $ this ->get ('/fonts/list ' );
195+
196+ if (is_array ($ fonts ) && count ($ fonts ) > 0 ) {
197+ $ ret = array_map ('trim ' , $ fonts );
198+ }
199+
200+ return $ ret ;
201+ }
202+
185203 /**
186204 * Return an array properties for the ReportingCloud account
187205 *
Original file line number Diff line number Diff line change @@ -298,6 +298,23 @@ public function testGetTemplateList()
298298
299299 // -----------------------------------------------------------------------------------------------------------------
300300
301+ public function testGetFontList ()
302+ {
303+ $ fonts = $ this ->reportingCloud ->getFontList ();
304+
305+ $ this ->assertInternalType (PHPUnit_IsType::TYPE_ARRAY , $ fonts );
306+
307+ $ this ->assertContains ('Times New Roman ' , $ fonts );
308+ $ this ->assertContains ('Arial ' , $ fonts );
309+ $ this ->assertContains ('Courier New ' , $ fonts );
310+
311+ $ this ->assertArrayHasKey (0 , $ fonts );
312+ $ this ->assertArrayHasKey (1 , $ fonts );
313+ $ this ->assertArrayHasKey (2 , $ fonts );
314+ }
315+
316+ // -----------------------------------------------------------------------------------------------------------------
317+
301318 public function testGetAccountSettings ()
302319 {
303320 $ response = $ this ->reportingCloud ->getAccountSettings ();
You can’t perform that action at this time.
0 commit comments