File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -209,9 +209,9 @@ private function parseRule() {
209
209
if ($ this ->comes ('! ' )) {
210
210
$ this ->consume ('! ' );
211
211
$ this ->consumeWhiteSpace ();
212
- $ sImportantMarker = $ this ->consumeUntil ( ' ; ' );
212
+ $ sImportantMarker = $ this ->consume ( strlen ( ' important ' ) );
213
213
if (mb_convert_case ($ sImportantMarker , MB_CASE_LOWER ) !== 'important ' ) {
214
- throw new Exception ("! was not followed by “important” " );
214
+ throw new Exception ("! was followed by “ " . $ sImportantMarker . " ”. Expected “important” " );
215
215
}
216
216
$ oRule ->setIsImportant (true );
217
217
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ require_once ('CSSParser.php ' );
4
+
5
+ class CSSParserTests extends PHPUnit_Framework_TestCase {
6
+ function testCssFiles () {
7
+
8
+ $ sDirectory = dirname (__FILE__ ).DIRECTORY_SEPARATOR .'files ' ;
9
+ if ($ rHandle = opendir ($ sDirectory )) {
10
+ /* This is the correct way to loop over the directory. */
11
+ while (false !== ($ sFileName = readdir ($ rHandle ))) {
12
+ if (strpos ($ sFileName , '. ' ) === 0 ) {
13
+ continue ;
14
+ }
15
+ if (strrpos ($ sFileName , '.css ' ) !== strlen ($ sFileName )-strlen ('.css ' )) {
16
+ continue ;
17
+ }
18
+ $ oParser = new CSSParser (file_get_contents ($ sDirectory .DIRECTORY_SEPARATOR .$ sFileName ));
19
+ try {
20
+ $ oParser ->parse ();
21
+ } catch (Exception $ e ) {
22
+ $ this ->fail ($ e );
23
+ }
24
+ }
25
+ closedir ($ rHandle );
26
+ }
27
+ }
28
+ }
Original file line number Diff line number Diff line change
1
+ div .rating-cancel , div .star-rating {float : left;width : 17px ;height : 15px ;text-indent : -999em ;cursor : pointer;display : block;background : transparent;overflow : hidden}
2
+ div .rating-cancel , div .rating-cancel a {background : url (images/delete.gif) no-repeat 0 -16px }
3
+ div .star-rating , div .star-rating a {background : url (images/star.gif) no-repeat 0 0px }
4
+ div .rating-cancel a , div .star-rating a {display : block;width : 16px ;height : 100% ;background-position : 0 0px ;border : 0 }
5
+ div .star-rating-on a {background-position : 0 -16px !important }
6
+ div .star-rating-hover a {background-position : 0 -32px }
7
+ div .star-rating-readonly a {cursor : default !important }
8
+ div .star-rating {background : transparent!important ; overflow : hidden!important }
You can’t perform that action at this time.
0 commit comments