Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
ZurmoCssInUtilTest.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 
38  {
39  public function testSplitMediaQueries()
40  {
41  $css = "body.outlook p {display: inline /*!important*/;}
42  @media screen {body {width: 75%;}}
43  table.round td {-webkit-border-radius: 500px;-moz-border-radius: 500px;border-radius: 500px}";
44  $mediaQuery = ZurmoCssInUtil::splitMediaQueries($css);
45  $this->assertEquals(" @media screen {body {width: 75%;}}\n", $mediaQuery[1]);
46 
47  $css = "body.outlook p {display: inline /*!important*/;}
48  @media screen {body {width: 75%;}}\n";
49  $mediaQuery = ZurmoCssInUtil::splitMediaQueries($css);
50  $this->assertEquals(" @media screen {body {width: 75%;}}\n", $mediaQuery[1]);
51 
52  $css = "body.outlook p {display: inline /*!important*/;}
53  @media screen {body {width: 75%;}}";
54  $mediaQuery = ZurmoCssInUtil::splitMediaQueries($css);
55  $this->assertEquals(" @media screen {body {width: 75%;}}\n", $mediaQuery[1]);
56 
57  $css = "body.outlook p {display: inline /*!important*/;} @media screen {body {width: 75%;}}";
58  $mediaQuery = ZurmoCssInUtil::splitMediaQueries($css);
59  $this->assertEquals(" @media screen {body {width: 75%;}}\n", $mediaQuery[1]);
60 
61  $css = "@media screen {body {width: 75%;}}";
62  $mediaQuery = ZurmoCssInUtil::splitMediaQueries($css);
63  $this->assertEquals(" @media screen {body {width: 75%;}}\n", $mediaQuery[1]);
64 
65  $css = "@media {}";
66  $mediaQuery = ZurmoCssInUtil::splitMediaQueries($css);
67  $this->assertEquals(" @media {}\n", $mediaQuery[1]);
68  }
69 
70  public function testSplitMediaQueriesWithComments()
71  {
72  $css = "body.outlook p {display: inline /*!important*/;}
73  /* @media screen {body */
74  @media screen {body {width: 75%;}}
75  table.round td {-webkit-border-radius: 500px;-moz-border-radius: 500px;border-radius: 500px}";
76  $mediaQuery = ZurmoCssInUtil::splitMediaQueries($css);
77  $this->assertEquals(" @media screen {body {width: 75%;}}\n", $mediaQuery[1]);
78  }
79 
80  public function testReferencedInvalidCSSFilePathsAndUrls()
81  {
82  // test for invalid file paths
83  // test for 404 urls
84  // Begin Not Coding Standard
85  $htmlContent = <<<CSS
86 <!DOCTYPE html>
87 <!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
88 <!--[if IE 7]><html class="no-js lt-ie9 lt-ie8"> <![endif]-->
89 <!--[if IE 8]><html class="no-js lt-ie9"> <![endif]-->
90 <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
91  <head>
92  <base href="http://www.zurmo.com/images/" target="_blank">
93  <meta charset="utf-8">
94  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
95  <title>Zurmo CRM &mdash; Gamified, Social, Intuitive Customer Relationship Management</title>
96  <meta name="description" content="">
97  <meta name="viewport" content="width=device-width">
98  <meta name="google-site-verification" content="RAKz9Hv052t8VptkOvCyFCryGJ72VRfVVnSR-ZhkhFo" />
99  <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
100  <link rel="shortcut icon" href="icons/favicon.ico">
101  <link href="//fonts.googleapis.com/css?family=Lato:100,400,700,400italic" rel="stylesheet" type="text/css">
102  <link href="//fonts.googleapis.com/css?family=Arvo:400,400italic" rel="stylesheet" type="text/css">
103  <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
104  <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.2.min.js"><\/script>')</script>
105  <!--[if lt IE 9]><script src="js/vendor/html5shiv.js"></script><![endif]-->
106  <link rel="stylesheet" type="text/css" href="../fusion.css">
107  <link rel="stylesheet" type="text/css" href="/../style.css">
108  <link href="css/zurmo.css" rel="stylesheet" media="screen" type="text/css">
109  <link href="http://www.zurmo.com/css/zurmo.css" rel="stylesheet" media="screen" type="text/css">
110  <link href="http://www.zurmo.com/css/zurmo-invalid.css" rel="stylesheet" media="screen" type="text/css">
111  <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://zurmo.com/wordpress/xmlrpc.php?rsd" />
112  <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://zurmo.com/wordpress/wp-includes/wlwmanifest.xml" />
113  <meta name="generator" content="WordPress 3.8.4" />
114  <script type="text/javascript">
115  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
116  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
117  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
118  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
119 
120  ga('create', 'UA-38681687-1', 'auto');
121  ga('send', 'pageview');
122  </script>
123  </head>
124  <body id="home" class="com">
125  </body>
126 </html>
127 CSS;
128  // End Not Coding Standard
129 
130  $cssInUtil = new ZurmoCssInUtil();
131  $cssInUtil->setMoveStyleBlocksToBody();
132  $convertedhtmlContent = $cssInUtil->inlineCSS(null, $htmlContent);
133  }
134  }
135 ?>
Definition: Zurmo.php:40
Generated on Sun Jul 5 2020 07:10:29
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.