[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/lib/tests/ -> csslib_test.php (summary)

This file contains the unittests for the css optimiser in csslib.php

Copyright: 2012 Sam Hemelryk
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 1324 lines (63 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

core_csslib_testcase:: (22 methods):
  get_optimiser()
  test_background()
  test_borders()
  test_colors()
  test_widths()
  test_margins()
  test_padding()
  test_cursor()
  test_vertical_align()
  test_float()
  test_invalid_css_handling()
  test_break_things()
  test_bulk_processing()
  test_css_is_colour()
  test_css_is_width()
  test_broken_css_found_in_moodle()
  test_keyframe_css_animation()
  test_media_rules()
  test_css_optimisation_ordering()
  test_css_chunking()
  test_css3()
  test_browser_hacks()


Class: core_csslib_testcase  - X-Ref

CSS optimiser test class.

get_optimiser()   X-Ref
Returns a CSS optimiser

return: css_optimiser

test_background()   X-Ref
Background colour tests.

When testing background styles it is important to understand how the background shorthand works.
background shorthand allows the following styles to be specified in a single "background" declaration:
- background-color
- background-image
- background-repeat
- background-attachment
- background-position

If the background shorthand is used it can contain one or more of those (preferabbly in that order).
Important it does not need to contain all of them.
However even if it doesn't contain values for all styles all of the styles will be affected.
If a style is missed from the shorthand background style but has an existing value in the rule then the existing value
is cleared.

For example:
.test {background: url(\'test.png\');background: bottom right;background:#123456;}
will result in:
.test {background:#123456;}

And:
.test {background-image: url(\'test.png\');background:#123456;}
will result in:
.test {background:#123456;}

test_borders()   X-Ref
Border tests.


test_colors()   X-Ref
Test colour styles.


test_widths()   X-Ref
Test widths.


test_margins()   X-Ref
Test margin styles.


test_padding()   X-Ref
Test padding styles.


test_cursor()   X-Ref
Test cursor optimisations


test_vertical_align()   X-Ref
Test vertical align optimisations


test_float()   X-Ref
Test float optimisations


test_invalid_css_handling()   X-Ref
Test some totally invalid CSS optimisation.


test_break_things()   X-Ref
Try to break some things.


test_bulk_processing()   X-Ref
A bulk processing test.


test_css_is_colour()   X-Ref
Test CSS colour matching.


test_css_is_width()   X-Ref
Test the css_is_width function.


test_broken_css_found_in_moodle()   X-Ref
This function tests some of the broken crazy CSS we have in Moodle.
For each of these things the value needs to be corrected if we can be 100%
certain what is going wrong, Or it needs to be left as is.


test_keyframe_css_animation()   X-Ref
Test keyframe declarations.


test_media_rules()   X-Ref
Test media declarations.


test_css_optimisation_ordering()   X-Ref
Test the ordering of CSS optimisationss


test_css_chunking()   X-Ref
Test CSS chunking


test_css3()   X-Ref
Test CSS3.


test_browser_hacks()   X-Ref
Test browser hacks here.




Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1