sabberworm / PHP-CSS-Parser

A Parser for CSS Files written in PHP. Allows extraction of CSS files into a data structure, manipulation of said structure and output as (optimized) CSS

Home Page:http://www.sabberworm.com/blog/2010/6/10/php-css-parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rework the tests

oliverklee opened this issue · comments

I'd like to rework the tests like this (in multiple steps):

  • #252 change the topmost test namespace from Sabberworm\CSS to Sabberworm\CSS\Tests so that tests have their own namespace (so that one namespace does not map to two different directories)
  • #252 add PSR-4 dev-autoloading for the tests
  • change $this->assert* to self::assert* (as the assert methods are static, and think that it's cleaner to call static methods statically)
  • change the test names from using the test prefix (e.g., testStringQuotingType) to use the @test annotation so that the tests names are shorter and can later be reworded to be statements like emptyStringDoesNotProduceAnyRules (as a made-up example)
  • reword the test names to be sentences describing the tested behavior
  • split up some test methods so that each test (in the optimal case) tests exact one piece of behavior (which makes the tests easier to understand, and which also helps debug the cause of a problem if a test fails)

@sabberworm @westonruter Would these changes be okay for you?

Sounds good, thanks. Thanks for tackling this.